BBM: Recalculate 2FA for minimal_access_users

Related to #534094 (closed) & !225038 (merged)

What does this MR do and why?

Database Review

Introduced !225317 (b20ced8c) in the first commit which was later optimized after reviews in !235857 (closed) to the current iteration.

db:check-migrations

https://gitlab.com/gitlab-org/gitlab/-/jobs/14795939540

Partial index

exec CREATE INDEX tmp_idx_members_on_access_level_source_type_requested_at_id ON members USING btree (id) WHERE ((access_level = 5) AND (source_type = 'Namespace') AND (requested_at IS NULL));

Time Estimation

Based on !235857 (comment 3391823398), it should take ~11hrs not 3 months like the bot's estimate.

Post Deployment Tracking

Steps
  1. Verify deployment with chatops: /chatops gitlab run batched_background_migrations list --job-class-name RecalculateMinAccessTwoFactorEnforcementOnMembers
  2. Use kibana with json.message: Minimal_access user group 2FA enforcement changed. using the pubsub-sidekiq-inf-gprd* data-view to visualize progress: https://log.gprd.gitlab.net/app/r/s/4Od5F
  3. If some goes wrong, pause/resume: /chatops gitlab run batched_background_migrations pause MIGRATION_ID
  4. Leave a confidential note update on the main work item at the beginning and end.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hakeem Abdul-Razak

Merge request reports

Loading
Loading