Uploaded image for project: 'Migration Platform'
  1. Migration Platform
  2. MIG-30

Upgrading CMAC while a plan is running causes inconsistency in database tables

    XMLWordPrintable

Details

    • 2

    Description

      Issue Summary

      When upgrading CMAC from 1.0.9 (the embedded version) to latest, if a plan is running while the upgrade happens then the threads are shutdown without the plans finishing. ON restart, the data is inconsistent.

      Environment

      • A version of Confluence with CMAC 1.0.9

      Steps to Reproduce

      1. Start a fresh Confluence with CMAC 1.0.9
      2. Create some spaces and start the migration plan
      3. Upgrade CMAC before the plans have finished

      Expected Results

      CMAC should handle the old data correctly in the database tables.

      Actual Results

      The below exception (for example) is thrown in the atlassian-confluence.log file:

      2019-05-31 11:04:57,463 ERROR [Caesium-1-3] [migration.agent.queue.QueueBroker] error An error occurred when getting the next batch for consumer type: ATTACHMENT_UPLOAD. Message: No enum constant com.atlassian.migration.agent.entity.WorkItem.Status.STOPPED
      java.lang.IllegalArgumentException: No enum constant com.atlassian.migration.agent.entity.WorkItem.Status.STOPPED
      

      Notes

      Workaround

      See also the Restore the Cloud Migration Assistant for Confluence to the default version guide.

      1. Drop CMAC and the migration tables from the database (some tables might not exist or have different foreign key relationships. Run this again if there are foreign key contsraints.) (This is for MySQL, adjust as necessary)
        delete from confluence.PLUGINDATA where PLUGINDATA.PLUGINKEY = 'com.atlassian.migration.agent';
        DROP TABLE `confluence`.`MIG_ANALYTICS_EVENT`;
        DROP TABLE `confluence`.`MIG_ATTACHMENT`;
        DROP TABLE `confluence`.`MIG_DB_CHANGELOG_LOCK`;
        DROP TABLE `confluence`.`MIG_DB_CHANGELOG`;
        DROP TABLE `confluence`.`MIG_SEQUENCES`;
        DROP TABLE `confluence`.`MIG_STATS`;
        DROP TABLE `confluence`.`MIG_STEP`;
        DROP TABLE `confluence`.`MIG_TASK`;
        DROP TABLE `confluence`.`MIG_WORK_ITEM`;
        DROP TABLE `confluence`.`MIG_PLAN`;
        DROP TABLE `confluence`.`MIG_CLOUD_SITE`;
        

        Reinstall CMAC from Marketplace and recreate the plans.

      This is similar to plans being stuck in RUNNING state when Confluence restarts.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jrichards@atlassian.com James Richards
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: