Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-11994

Race condition in HiLoIdRepairUpgradeTask and ResetHiLoAfterImportListener can lead to primary key violations in upgrade tasks

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.9
    • 2.8, 2.8.1
    • None

      Resetting the ResettableHiLoIdGenerator now happens in two parts:

      • the HiLoIdRepairUpgradeTask determines the lowest possible safe 'hi' value and puts it in the database
      • the ResetHiLoAfterImportListener forces the configured ID generators to retrieve the next hi value from the database

      Unfortunately there is a gap between the two during which more IDs may be assigned by other upgrade tasks. In Studio's case, the InitApplicationKeysUpgradeTask was being run with stale ID generators, causing really hard-to-track-down duplicate key errors.

      The ResetHiLoAfterImportListener was installed to make imports safer in a cluster (previously, the generators were only being reset properly on the same node as the import was performed). My recommended fix would be to create a specific HiLoIdResetEvent event that is thrown by the HiLoIdRepairUpgradeTask specifically for the ResetHiLoAfterImportListener, so that the IDs are all properly reset on all nodes before the restore continues.

            [CONFSERVER-11994] Race condition in HiLoIdRepairUpgradeTask and ResetHiLoAfterImportListener can lead to primary key violations in upgrade tasks

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2884370 ] New: CONFSERVER Bug Workflow v4 [ 2979311 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2787985 ] New: JAC Bug Workflow v3 [ 2884370 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2720388 ] New: JAC Bug Workflow v2 [ 2787985 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2399617 ] New: JAC Bug Workflow [ 2720388 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2298389 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2399617 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2233291 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 2298389 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2194346 ] New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2233291 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 1917390 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2194346 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v3 [ 1718836 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 1917390 ]
            Katherine Yabut made changes -
            Workflow Original: CONF Bug Subtask WF (TEMP) [ 1671961 ] New: Confluence Workflow - Public Facing - Restricted v3 [ 1718836 ]

              alynch Andrew Lynch (Inactive)
              cmiller@atlassian.com Charles Miller (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: