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

Confluence upgrade process switches to 1 thread for SQL Server in 4.0.1 and above

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 5.8.13
    • 5.7, 5.6.6, 5.7.1, 5.7.3, 5.7.4, 5.8.2, 5.8.4, 5.8.5, 4.7.3
    • None

    Description

      Summary

      When Confluence switched from wiki markup to XHTML, there was a bug that would deadlock MS SQL Server during the migration process. A stop-gap measure was put in place to temporarily set the number of threads used to 1. This bug was fixed in 4.0.1, but the stop-gap was never removed. Confluence still defaults to 1 thread when an upgrade is occurring on a SQL Server database. Some upgrades are taking upwards of 40 hours to complete due to this.

      Environment

      • Microsoft SQL Server

      Steps to Reproduce

      1. Upgrade to Confluence 5.8.4

      Expected Results

      DefaultSiteMigrator tasks run multi-threaded

      Actual Results

      DefaultSiteMigrator tasks run in 1 thread.
      The below exception is thrown in the atlassian-confluence.log file:

      2015-06-17 13:00:37,655 WARN [localhost-startStop-1] [render.xhtml.migration.DefaultSiteMigrator] getNumberOfThreads SQL Server detected so only one thread will be used in migration to avoid dead lock problems.
      

      Notes

      • The code to restrict the number of threads was added in 4.0 as a stop-gap to prevent deadlocks from occurring when SQL Server was used
      • The deadlock bug was fixed in 4.0.1 but the stop-gap was never removed
        • There is actually a comment in the source code that STILL EXISTS that states:

          This check won't be necessary once CONFDEV-5139 is implemented

      • This affects ALL versions of Confluence 4.0.1 and above

      Workaround

      There is a patch attached to this ticket that will run the migration in multiple threads for SQL Server instances. Steps to apply the patch are in this comment.

      Attachments

        1. confluence-5.0.3.jar
          6.98 MB
          Denise Unterwurzacher [Atlassian]
        2. confluence-5.0.3.jar
          6.98 MB
          Denise Unterwurzacher [Atlassian]
        3. DefaultWikiToXhtmlSiteMigrator.java
          8 kB
          Denise Unterwurzacher [Atlassian]
        4. PageTemplateWikiToXhtmlSiteMigrator.java
          7 kB
          Denise Unterwurzacher [Atlassian]
        5. WorkSourceBatchRunner.java
          6 kB
          Denise Unterwurzacher [Atlassian]

        Issue Links

          Activity

            People

              dunterwurzacher Denise Unterwurzacher [Atlassian] (Inactive)
              sbrannen@atlassian.com Branno
              Votes:
              8 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: