Geo: Zero-downtime upgrades step `gitlab-rake db:migrate` fails in 13.9.3 because of `allow_proxy_whitelist` rename
Summary
We attempted to fix #322991 (closed) in 13.9.3 but it appears that zero downtime upgrades are still failing for Geo.
Running sudo gitlab-rake db:migrate
fails
Steps to reproduce
- Follow Geo's zero-downtime instruction
- Run
sudo gitlab-rake db:migrate
and observe failure
Example Project
What is the current bug behavior?
Zero downtime upgrades fail
What is the expected correct behavior?
Zero downtime upgrades succeed
Relevant logs and/or screenshots
Expand for `sudo gitlab-rake db:migrate` output
-- remove_column(:application_settings, :asset_proxy_whitelist) rake aborted! StandardError: An error has occurred, all later migrations canceled: PG::DependentObjectsStillExist: ERROR: cannot drop column asset_proxy_whitelist of table application_settings because other objects depend on it DETAIL: trigger trigger_0d588df444c8 on table application_settings depends on column asset_proxy_whitelist of table application_settings HINT: Use DROP ... CASCADE to drop the dependent objects too. /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/v2.rb:115:in `block in teardown_rename_mechanism' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:121:in `run_block' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:130:in `block in run_block_with_transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:125:in `run_block_with_transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/with_lock_retries.rb:95:in `run' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:394:in `with_lock_retries' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/v2.rb:110:in `teardown_rename_mechanism' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers/v2.rb:53:in `cleanup_concurrent_column_rename' /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210105052229_clean_up_asset_proxy_whitelist_rename_on_application_settings.rb:11:in `up' /opt/gitlab/embedded/bin/bundle:23:in `load' /opt/gitlab/embedded/bin/bundle:23:in `'
Triggers:
trigger_0d588df444c8 BEFORE UPDATE OF asset_proxy_whitelist ON application_settings FOR EACH ROW EXECUTE PROCEDURE function_for_trigger_0d588df444c8()
trigger_1572cbc9a15f BEFORE UPDATE OF asset_proxy_whitelist ON application_settings FOR EACH ROW EXECUTE PROCEDURE function_for_trigger_1572cbc9a15f()
trigger_22a39c5c25f3 BEFORE UPDATE OF asset_proxy_allowlist ON application_settings FOR EACH ROW EXECUTE PROCEDURE function_for_trigger_22a39c5c25f3()
trigger_9a96291bb38d BEFORE INSERT ON application_settings FOR EACH ROW EXECUTE PROCEDURE function_for_trigger_9a96291bb38d()
trigger_b01442420ce6 BEFORE UPDATE OF asset_proxy_allowlist ON application_settings FOR EACH ROW EXECUTE PROCEDURE function_for_trigger_b01442420ce6()
trigger_e40a6f1858e6 BEFORE INSERT ON application_settings FOR EACH ROW EXECUTE PROCEDURE function_for_trigger_e40a6f1858e6()
Results of GitLab environment info
Version 13.8.x
Possible fixes
Remove the triggers manually, see #324160 (comment 527525971) for detailed information.
Edited by Douglas Barbosa Alexandre