Commit 03bf4af1 authored by Stan Hu's avatar Stan Hu

Fix group destroy not working with Gitaly Cluster

Previously when a namespace was deleted, it would always attempt to
remove the legacy storage path. For example, for namespace `test-group`,
Rails would issue a removal for `/path/to/test-group` just in case there
is data there.

If the path does not exist, Gitaly raises an Invalid Argument GRPC (3)
exception, but Gitaly Cluster raises an Internal error (13).

Since hashed storage is now the default and the legacy path shouldn't be
used at all, we can avoid this error entirely by not attempting to
delete the legacy path.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/276501
parent e1e7da41
......@@ -90,7 +90,7 @@ module Storage
end
def old_repository_storages
@old_repository_storage_paths ||= repository_storages
@old_repository_storage_paths ||= repository_storages(legacy_only: true)
end
def repository_storages(legacy_only: false)
......
---
title: Fix group destroy not working with Gitaly Cluster
merge_request: 46934
author:
type: fixed
......@@ -687,7 +687,7 @@ RSpec.describe Namespace do
let!(:project) { create(:project_empty_repo, namespace: namespace) }
it 'has no repositories base directories to remove' do
allow(GitlabShellWorker).to receive(:perform_in)
expect(GitlabShellWorker).not_to receive(:perform_in)
expect(File.exist?(path_in_dir)).to be(false)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment