Issue Summary
Cancelling repository migration to mesh doesn't cancel the migration job if Bitbucket node is crashed while a repository is in migrating state
This is reproducible on Data Center: Yes
Steps to Reproduce
- Initiate Repository migration to mesh
- While the repository is in migrating state, kill (using SIGKILL and not SIGINT) the Primary Bitbucket node process
- Monitor the Repository state, it will hung in migrating state forever
- When we issue cancel call to Migration job with API /rest/api/latest/migration/mesh/<jobId>/cancel the repository state will change to CANCELING but will not cancel
Expected Results
The migration job gets cancelled.
Actual Results
The migration job state will change to CANCELING & remain in this state forever.
Workaround
The Migration job and Repository state has to be updated on database
Update Migration Job State
UPDATE bb_mesh_migration_job set state = 3, end_timestamp = current_timestamp where id = <Migration Job ID>;
Update Repository State
UPDATE bb_mesh_migration_queue set state = 5 where migration_job_id = <Migration Job ID> AND repository_id = <repo_id>;
Update bb_job table
UPADATE bb_job SET progress_message='The migration was canceled', state=700, end_timestamp = current_timestamp WHERE id = <Migration Job ID>