Skip to content

Ignore Elasticsearch database columns

Description

We moved some Elasticsearch application settings to a new JSONB column !174172 (merged).

In that migration, we also dropped the original columns without following the multi-milestone release process. This caused an incident: gitlab-com/gl-infra/production#19079 (closed).

We updated the last migration, keeping the original columns !176987 (merged).

At the moment, we have the original columns and the JSONB columns with a jsob accessor. When we update any setting, it gets updated in both places. Now, we will follow the process to drop columns: https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#dropping-columns

Testing

  1. Add a License http://localhost:3000/admin/application_settings/general#js-add-license-toggle
  2. Test/Modify the Elasticsearch settings http://localhost:3000/admin/application_settings/advanced_search#js-elasticsearch-settings
  3. Review the database data with rails console, for example after updating the username:
    ApplicationSetting.current_without_cache.attribute_in_database(:elasticsearch_username)
    ApplicationSetting.current_without_cache.elasticsearch_username
    ApplicationSetting.current_without_cache.elasticsearch["elasticsearch_username"]

Related to #511921 (closed).

Edited by Arturo Herrero

Merge request reports

Loading