Add IID to Operations Feature Flags and Backfill
What does this MR do?
- Add an
iid
column to theoperations_feature_flags
table. - Add a
UNIQUE
index on theoperations_feature_flags
table on theproject_id, iid
columns. - Backfill the
iid
column for existing rows in theoperations_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 iid
s is not reversible. If we set the column value to NULL
, it would delete iid
s set during feature flag creation. See: !20871 (comment 255425212)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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