Prepare async index removal of token for ci_builds
What does this MR do and why?
As titled, prepare the async index removal of index_ci_builds_on_token_encrypted for ci_builds.
Because index_ci_builds_on_token_encrypted will be replaced with unique_ci_builds_token_encrypted_and_partition_id to help with the partition for ci_builds
How to set up and validate locally
-
Verify the index does exist
gitlabhq_development=# \di+ index_ci_builds_on_token_encrypted; List of relations Schema | Name | Type | Owner | Table | Size | Description --------+------------------------------+-------+----------+-----------+-------+------------- public | index_ci_builds_on_token_encrypted | index | joe_1565 | ci_builds | 255 GB | (1 row) -
Enable feature flag
Feature.enable(:database_reindexing) -
Run migration with
bundle exec rails db:migrate -
Run
bundle exec rails gitlab:db:reindexso the index is destroyed asynchronously -
Verify the index no longer exist
gitlabhq_development=# \di+ index_ci_builds_on_token_encrypted; Did not find any relation named "index_ci_builds_on_token_encrypted".
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #391957 (closed)