Update MigrateRecordsToGhostUserInBatchesService retry logic to prevent from being blocked at one user
As an additional update from the issue, we can update the retry logic for MigrateRecordsToGhostUserInBatchesService by story a retry attribute for each row/user to avoid getting blocked if that deletion fails for a reasons. @ahegyi recommended:
We can use the same pattern that we have for loose foreign keys.
- Add the
consume_aftercolumn to theghost_user_migrationstable. - Set the
consume_aftervalue tocreated_atby default (could beNOW()as well) when theghost_user_migrationsrecord is created. - When a user deletion fails, catch the timeout error and update the
consume_afterwithTime.current + 30 minutes.
Additionally, we should retrieve a batch by ordering the rows by consume_after ASC