Commit e7cfad5c authored by Kamil Trzciński's avatar Kamil Trzciński

Mark `Projects::OverwriteProjectService#destroy_old_project` cross-DB

It appears that `#destroy_old_project` does `Project.transaction`
which makes `Projects::DestroyService#delete_ci_records!` to run
in a transaction.
parent ef09594c
...@@ -11,7 +11,9 @@ module Projects ...@@ -11,7 +11,9 @@ module Projects
move_before_destroy_relationships(source_project) move_before_destroy_relationships(source_project)
# Reset is required in order to get the proper # Reset is required in order to get the proper
# uncached fork network method calls value. # uncached fork network method calls value.
destroy_old_project(source_project.reset) ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/340256') do
destroy_old_project(source_project.reset)
end
rename_project(source_project.name, source_project.path) rename_project(source_project.name, source_project.path)
@project @project
......
...@@ -8,4 +8,3 @@ ...@@ -8,4 +8,3 @@
- "./spec/models/clusters/applications/runner_spec.rb" - "./spec/models/clusters/applications/runner_spec.rb"
- "./spec/requests/api/commits_spec.rb" - "./spec/requests/api/commits_spec.rb"
- "./spec/services/ci/retry_build_service_spec.rb" - "./spec/services/ci/retry_build_service_spec.rb"
- "./spec/services/projects/overwrite_project_service_spec.rb"
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