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 0000000000000000000000000000000000000000..4985044d6b7d15d91135c9c82c79e6365342de52 --- /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 ec8518516e3199c914df47ecd09b29997a104267..54469938a18b76bb253a5bbd606faf9377564347 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 c3823bc3866a5408d16acbcb3200dce92e7ce0fc..1295e32757ab4edac378d1a61e258934b6a8db17 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) }