Skip to content

Add IID to Operations Feature Flags and Backfill

Jason Goodman requested to merge ops-ff-iid into master

What does this MR do?

  • Add an iid column to the operations_feature_flags table.
  • Add a UNIQUE index on the operations_feature_flags table on the project_id, iid columns.
  • Backfill the iid column for existing rows in the operations_feature_flags table.

Issue: #33137 (closed)

Alternative implementation using a Sidekiq cron job: !22050 (closed)

Alternative implementation using SQL: !22130 (closed)

Alternative implementation using SQL and adding a backfill parameter to AtomicInternalId: !22175 (merged)

There are about 500 operations_feature_flags on production:

gitlabhq_production=> SELECT COUNT(id) FROM operations_feature_flags;
 count 
-------
   493
(1 row)

gitlabhq_production=> 

Update (2019-12-17): There are now about 550 operations_feature_flags on production:

gitlabhq_production=> SELECT COUNT(id) FROM operations_feature_flags;
 count 
-------
   558
(1 row)

gitlabhq_production=> 

All these feature flags will have the new iid column backfilled by the post migration.

The migration to backfill the iids is not reversible. If we set the column value to NULL, it would delete iids set during feature flag creation. See: !20871 (comment 255425212)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Jason Goodman

Merge request reports