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

High Database CPU utilization when create content properties for Draft objects (with disabled Collaborative editing)

      Issue Summary

      When method create from ContentPropertyServiceImpl class is called to create content property for content object with type Draft we perform request to the database which will try to retrieve ALL current pages from Content table. In cases when this table is big and there are many users who perform similar action it could lead to high Database CPU utilization.

      This problem could only be reproduced when Collaborative editing is disabled because we don't use Draft content type.

      Steps to Reproduce

      This problem was reported by a customer who used third party plugin (Numbered headers), but this situation could potentially happen in many other cases. I provide example with this plugin usage

      1. Disable Collaborative editing
      2. Install Numbered Headers plugin (or use anything that will call method create from ContentPropertyServiceImpl class)
      3. Create page
      4. Start editing page (object with type Draft will be created in Content table)
      5. Go to Logging and Profiling and press Enable SQL logging button
      6. Press Numbered Heading button
      7. Disable SQL logging
      8. Check  requests that were performed

      Expected Results

      All queries to content table should be filtered by content id of the draft record

      Actual Results

      There will be a query to retrieve all current pages from content table:

      select abstractpa0_.CONTENTID as CONTENTI1_12_,
             abstractpa0_.HIBERNATEVERSION as HIBERNAT2_12_,
             abstractpa0_.TITLE as TITLE4_12_,
             abstractpa0_.LOWERTITLE as LOWERTIT5_12_,
             abstractpa0_.VERSION as VERSION6_12_,
             abstractpa0_.CREATOR as CREATOR7_12_,
             abstractpa0_.CREATIONDATE as CREATION8_12_,
             abstractpa0_.LASTMODIFIER as LASTMODI9_12_,
             abstractpa0_.LASTMODDATE as LASTMOD10_12_,
             abstractpa0_.VERSIONCOMMENT as VERSION11_12_,
             abstractpa0_.PREVVER as PREVVER12_12_,
             abstractpa0_.CONTENT_STATUS as CONTENT13_12_,
             abstractpa0_.PAGEID as PAGEID14_12_,
             abstractpa0_.SPACEID as SPACEID15_12_,
             abstractpa0_.CHILD_POSITION as CHILD_P16_12_,
             abstractpa0_.PARENTID as PARENTI17_12_,
             abstractpa0_.CONTENTTYPE as CONTENTT3_12_
      from CONTENT abstractpa0_
      where abstractpa0_.CONTENTTYPE in ('PAGE', 'BLOGPOST') and
            (abstractpa0_.CONTENTTYPE in ('PAGE')) and
            (abstractpa0_.CONTENT_STATUS in ('current')) and
            (abstractpa0_.PREVVER is null)
      order by abstractpa0_.CONTENTID limit 273011, 501

      Workaround

      Enable Collaborative editing which doesn't use Draft objects

          Form Name

            [CONFSERVER-62807] High Database CPU utilization when create content properties for Draft objects (with disabled Collaborative editing)

            Minh Tran added a comment -

            A fix for this issue is available to Server and Data Center customers in Confluence 7.14.0
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Minh Tran added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 7.14.0 Upgrade now or check out the Release Notes to see what other issues are resolved.

              03cb0c04aa4f Irina Tiapchenko
              03cb0c04aa4f Irina Tiapchenko
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: