Skip to content

Reinstate ElasticsearchSettingsFromApplicationSettings migration

Background

Revert MR: Revert ElasticsearchSettingsFromApplicationSett... (!176987 - merged)

Original MR: Consolidate Elasticsearch application settings ... (!174172 - merged)

The ElasticsearchSettingsFromApplicationSettings post deploy migration was reverted and needs to be reinstated.

Proposal

The solution must follow the process of ignoring columns for one milestone before dropping them. There were issues with adding ignore column while moving to the same name columns in jsonb. Two options are:

  1. Keep column names the same and apply ignore_columns. Fix whatever issues are caused by it
  2. Change the elasticsearch jsonb column names. Migrate all data to the names. Add ignore_columns for the deprecated columns AND the elasticsearch_* jsonb fields. And remove all in the following milestone.

NOTE: for option 2 - I wrote up the plan to be extra safe due to rails schema cache. The jsonb fields may not be affected by rails schema cache if a key name changes (we should check with database team)

Final plan

We will follow the dropping columns approach as we confirm it works.

Reference: https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#dropping-columns

Edited by Arturo Herrero