[Production] Enqueue index_ci_builds_on_token_encrypted_partition_id_unique to postgres_reindex_queued_actions

Production Change

Change Summary

Because of gitlab-org/gitlab#382033 (closed) we are making sure all unique indexes on ci_builds includes the partition key in order to partition this table.

In gitlab-org/gitlab!106128 (merged) we attempted to create the following index which is currently invalid on production.

Indexes:
-   "index_ci_builds_on_token_encrypted_partition_id_unique" UNIQUE, btree (token_encrypted, partition_id) WHERE token_encrypted IS NOT NULL INVALID

As we discussed with the #database team we would like to re-enqueue this index manually to make sure it will be created successfully this weekend with our current reindexing strategy.

bundle exec rake gitlab:db:enqueue_reindexing_action['public.index_ci_builds_on_token_encrypted_partition_id_unique','ci']

Change Details

  1. Services Impacted - ServicePostgres
  2. Change Technician - @steveazz
  3. Change Reviewer - @steveazz
  4. Time tracking - 1 day
  5. Downtime Component - None

Detailed steps for the change

Change Steps - steps to take to execute the change

Rails console

  • Run the following command to enqueue this index manually
bundle exec rake gitlab:db:enqueue_reindexing_action['public.index_ci_builds_on_token_encrypted_partition_id_unique','ci']
  • Verify a record has been created in postgres_reindex_queued_actions
Gitlab::Database::SharedModel.using_connection(Ci::ApplicationRecord.connection) { Gitlab::Database::Reindexing::QueuedAction.queued.all.to_a }

Rollback

Rollback steps - steps to be taken in the event of a need to rollback this change

Rollback not necessary as this will only enqueue an index be created this weekend during low traffic

Monitoring

Key metrics to observe

Not much as this will be execute this weekend.

Change Reviewer checklist

C4 C3 C2 C1:

  • Check if the following applies:
    • The scheduled day and time of execution of the change is appropriate.
    • The change plan is technically accurate.
    • The change plan includes estimated timing values based on previous testing.
    • The change plan includes a viable rollback plan.
    • The specified metrics/monitoring dashboards provide sufficient visibility for the change.

C2 C1:

  • Check if the following applies:
    • The complexity of the plan is appropriate for the corresponding risk of the change. (i.e. the plan contains clear details).
    • The change plan includes success measures for all steps/milestones during the execution.
    • The change adequately minimizes risk within the environment/service.
    • The performance implications of executing the change are well-understood and documented.
    • The specified metrics/monitoring dashboards provide sufficient visibility for the change.
      • If not, is it possible (or necessary) to make changes to observability platforms for added visibility?
    • The change has a primary and secondary SRE with knowledge of the details available during the change window.
    • The labels blocks deployments and/or blocks feature-flags are applied as necessary

Change Technician checklist

  • Check if all items below are complete:
    • The change plan is technically accurate.
    • This Change Issue is linked to the appropriate Issue and/or Epic
    • Change has been tested in staging and results noted in a comment on this issue.
    • A dry-run has been conducted and results noted in a comment on this issue.
    • For C1 and C2 change issues, the change event is added to the GitLab Production calendar.
    • For C1 and C2 change issues, the SRE on-call has been informed prior to change being rolled out. (In #production channel, mention @sre-oncall and this issue and await their acknowledgement.)
    • Release managers have been informed (If needed! Cases include DB change) prior to change being rolled out. (In #production channel, mention @release-managers and this issue and await their acknowledgment.)
    • There are currently no active incidents that are severity1 or severity2
    • If the change involves doing maintenance on a database host, an appropriate silence targeting the host(s) should be added for the duration of the change.
Edited by Steve Xuereb