Commit 284d06f8 authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch '4553-geo-hashed-storage-migration-failure-does-not-log-to-sentry-or-geo-log-well' into 'master'

Improve error handling when namespace cannot be moved

Closes #4553

See merge request gitlab-org/gitlab-ee!8926
parents 549f2e41 fbb4368e
......@@ -26,7 +26,7 @@ module Geo
project.expire_caches_before_rename(old_disk_path)
if migrating_from_legacy_storage? && !move_repository
log_error("Repository could not be migrated to Hashed Storage", project_id: project.id, source: old_disk_path, target: new_disk_path)
log_error("Repository could not be migrated to Hashed Storage: move_repository failed", project_id: project.id, source: old_disk_path, target: new_disk_path)
raise RepositoryCannotBeRenamed, "Repository #{old_disk_path} could not be renamed to #{new_disk_path}"
end
......
......@@ -289,10 +289,12 @@ module Gitlab
#
def mv_namespace(storage, old_name, new_name)
Gitlab::GitalyClient::NamespaceService.new(storage).rename(old_name, new_name)
rescue GRPC::InvalidArgument
rescue GRPC::InvalidArgument => e
Gitlab::Sentry.track_acceptable_exception(e, extra: { old_name: old_name, new_name: new_name, storage: storage })
false
end
alias_method :mv_directory, :mv_namespace
alias_method :mv_directory, :mv_namespace # Note: ShellWorker uses this alias
def url_to_repo(path)
Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git"
......
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