Workaround does not apply for Geo caching bug
Summary
We fixed a caching-related bug for the failover process in 12.6 and described a workaround for prior versions. However, the workaround appears not to be available in GitLab 11.11.8
because some commands are missing.
Steps to reproduce
(How one can reproduce the issue - this is very important)
More details in https://gitlab.zendesk.com/agent/tickets/156177
- Try to perform a failover on
11.11.8
- Run
sudo gitlab-rake geo:set_secondary_as_primary
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Enabled Geo primary node cannot be disabled
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/tasks/geo.rake:195:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/tasks/geo.rake:180:in `block (2 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => geo:set_secondary_as_primary
(See full trace by running task with --trace)
- Run
sudo gitlab-rails c
-------------------------------------------------------------------------------------
GitLab: 11.11.8-ee (e2d0c51ffc5)
GitLab Shell: 9.1.0
PostgreSQL: 9.6.11
Geo enabled: yes
Geo server: secondary
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.1.7)
irb(main):001:0> Rails.application.load_tasks; nil
=> nil
irb(main):002:0> Gitlab::Geo.expire_cache_keys!([:primary_node, :current_node])
Traceback (most recent call last):
1: from (irb):2
NoMethodError (undefined method `expire_cache_keys!' for Gitlab::Geo:Module)
Did you mean? expire_cache!
irb(main):003:0> Gitlab::Geo.expire_cache!([:primary_node, :current_node])
Traceback (most recent call last):
2: from (irb):3
1: from ee/lib/gitlab/geo.rb:101:in `expire_cache!'
ArgumentError (wrong number of arguments (given 1, expected 0))
What is the current bug behavior?
(What actually happens)
Workaround commands are not available
What is the expected correct behavior?
(What you should see instead) We should be able to promote a primary
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)