Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2020-04-28 08:33:11 +0300
committerJohn Cai <jcai@gitlab.com>2020-04-28 08:33:11 +0300
commitfabee50b7b98d7b483803eec7f9e5140c0562c25 (patch)
treef1797923e0ac970e39bf69fefcd5254f81b120e7
parent97ccac5bb6c9156567578fe8a65d8241f8f1d7cf (diff)
parent715f963d5bed3ececed36cda2e21e5aea5ce6555 (diff)
Merge branch 'cleanup-commit-graph-chain-lock' into 'master'
Cleanup commit-graph-chain.lock file after crash See merge request gitlab-org/gitaly!2099
-rw-r--r--changelogs/unreleased/cleanup-commit-graph-chain-lock.yml5
-rw-r--r--internal/service/repository/cleanup.go2
-rw-r--r--internal/service/repository/gc_test.go1
3 files changed, 7 insertions, 1 deletions
diff --git a/changelogs/unreleased/cleanup-commit-graph-chain-lock.yml b/changelogs/unreleased/cleanup-commit-graph-chain-lock.yml
new file mode 100644
index 000000000..4985044d6
--- /dev/null
+++ b/changelogs/unreleased/cleanup-commit-graph-chain-lock.yml
@@ -0,0 +1,5 @@
+---
+title: cleanup commit-graph-chain.lock file after crash
+merge_request: 2099
+author:
+type: fixed
diff --git a/internal/service/repository/cleanup.go b/internal/service/repository/cleanup.go
index ec8518516..54469938a 100644
--- a/internal/service/repository/cleanup.go
+++ b/internal/service/repository/cleanup.go
@@ -15,7 +15,7 @@ import (
"google.golang.org/grpc/status"
)
-var lockFiles = []string{"config.lock", "HEAD.lock"}
+var lockFiles = []string{"config.lock", "HEAD.lock", "objects/info/commit-graphs/commit-graph-chain.lock"}
func (*server) Cleanup(ctx context.Context, in *gitalypb.CleanupRequest) (*gitalypb.CleanupResponse, error) {
if err := cleanupRepo(ctx, in.GetRepository()); err != nil {
diff --git a/internal/service/repository/gc_test.go b/internal/service/repository/gc_test.go
index c3823bc38..1295e3275 100644
--- a/internal/service/repository/gc_test.go
+++ b/internal/service/repository/gc_test.go
@@ -323,6 +323,7 @@ func TestCleanupInvalidKeepAroundRefs(t *testing.T) {
}
func createFileWithTimes(path string, mTime time.Time) {
+ os.MkdirAll(filepath.Dir(path), 0755)
ioutil.WriteFile(path, nil, 0644)
os.Chtimes(path, mTime, mTime)
}