Skip to content

No-op and remove scheduled "invalid member" migrations

Serena Fang requested to merge delete_remove_invalid_member_migration into master

What does this MR do and why?

Issue: #375297 (closed)

ScheduleDestroyInvalidProjectMembers and ScheduleDestroyInvalidGroupMembers had non-optimized queries that caused a statement timeout. In this MR, we no-op the migrations and remove the scheduled migrations. In a future MR we'll re-implement the migrations using an index to make it more performant.


DB:

gitlabhq_dblab=# select id from batched_background_migrations where job_class_name = 'DestroyInvalidGroupMembers';
 id
-----
 186
(1 row)

gitlabhq_dblab=# select count(*) from batched_background_migration_jobs where batched_background_migration_id = 186;
 count
-------
     1
(1 row)

gitlabhq_dblab=# select id from batched_background_migrations where job_class_name = 'DestroyInvalidProjectMembers';
 id
-----
 221
(1 row)

gitlabhq_dblab=# select count(*) from batched_background_migration_jobs where batched_background_migration_id = 221;
 count
-------
   264
(1 row)

gitlabhq_dblab=# select count(*) from batched_background_migration_job_transition_logs where batched_background_migration_job_id in ( select id from batched_background_migration_jobs where batched_background_migration_id = 221);
 count
-------
   530
(1 row)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Serena Fang

Merge request reports