Geo: promoting secondary node into primary doesnt remove `database_geo.yml`
We are not cleaning up the database_geo.yml
when promoting a node to primary, and this makes the primary unable to boot up, as it will keep trying to connect to the now disabled Geo Tracking Database.
==> /var/log/gitlab/sidekiq/current <==
2018-04-25_02:17:20.70730 could not connect to server: No such file or directory
2018-04-25_02:17:20.70733 Is the server running locally and accepting
2018-04-25_02:17:20.70734 connections on Unix domain socket "/var/opt/gitlab/geo-postgresql/.s.PGSQL.5431"?
2018-04-25_02:17:20.70788 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
2018-04-25_02:17:20.70789 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
2018-04-25_02:17:20.70790 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
2018-04-25_02:17:20.70790 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
2018-04-25_02:17:20.70790 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
2018-04-25_02:17:20.70790 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
2018-04-25_02:17:20.70791 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
2018-04-25_02:17:20.70861 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
2018-04-25_02:17:20.70862 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
2018-04-25_02:17:20.70863 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
Workaround: rm /var/opt/gitlab/gitlab-rails/etc/database_geo.yml
Edited by Brett Walker