Gitlab elasticsearch client configuration is not respected in rails console

Discovered while working on https://gitlab.com/gitlab-org/gitlab-ee/issues/11419

In config/initializers/elastic_client_setup.rb we try to ensure that:

  1. Every process importing the gitlab-ee environment returns a correctly-configured elasticsearch client out of Elasticsearch::Model.client
  2. Every time the elasticsearch settings are changed in the database (application_settings.elastic_*), all gitlab-ee-environment-importing processes refresh their client instance with the new settings.

However, in at least the Rails console (running gitlab-rails console), these settings are not respected, which can lead to surprising outcomes when debugging things.

I started work on an MR to improve this in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13807 , but forgot about requirement 2, so I'm going to close it unresolved.

Assignee Loading
Time tracking Loading