Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19654

Cancelling repository migration to mesh doesn't cancel the migration job if Bitbucket node is crashed while a repository is in *migrating* state

XMLWordPrintable

      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 

      1. Initiate Repository migration to mesh
      2. While the repository is in migrating state, kill (using SIGKILL and not SIGINT) the Primary Bitbucket node process
      3. Monitor the Repository state, it will hung in migrating state forever
      4. 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> 

              mgoyal2@atlassian.com Manish
              de843d56add4 Kalyan Kumar
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: