gitlab-rake geo:db:refresh_foreign_tables has a rails dependency but rails will be disabled on the geo-postgresql node
The logic here: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/package/libraries/config/roles/geo_secondary.rb#L28
Gitlab['gitlab_rails']['enable'] = rails_needed?
...
def self.rails_needed?
Gitlab['unicorn']['enable'] ||
Gitlab['sidekiq']['enable'] ||
Gitlab['sidekiq_cluster']['enable'] ||
Gitlab['geo_logcursor']['enable']
end
Overrides the value of gitlab_rails['enable']
.
So two questions come to mind:
- Should the value in
gitlab.rb
take precedence? - should we add
geo_postgresql
to the list of services that enable rails?
We issue a gitlab-rake geo:db:refresh_foreign_tables
on the geo tracking database nodes which reads db information from the rails config, the problem is that in the HA case where geo-postgresql
is the only service enabled the rails database config will never be updated as the rails recipe doesn't run.