Migrate user records to ghost in batch job runs
What does this MR do and why?
It splits Users::DestroyService
into a 2 steps workflow:
- keeps the first part of
Users::DestroyService
- migrating associated records to the ghost user and deleting records is migrated to
Users::MigrateRecordsToGhostUserService
Migration and deletion is now done in batches asynchronously with a limited execution time:
-
Users::MigrateRecordsToGhostUserInBatchesWorker
is a cron worker running every minutes - The worker executes
Users::MigrateRecordsToGhostUserInBatchesService
with execution time limit of 30 seconds -
Users::MigrateRecordsToGhostUserService
is executed for each user
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/366655.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Imre Farkas