-
Bug
-
Resolution: Fixed
-
Low
-
6.13.4
-
1
-
Severity 2 - Major
-
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
- Disable Collaborative editing
- Install Numbered Headers plugin (or use anything that will call method create from ContentPropertyServiceImpl class)
- Create page
- Start editing page (object with type Draft will be created in Content table)
- Go to Logging and Profiling and press Enable SQL logging button
- Press Numbered Heading button
- Disable SQL logging
- 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 |
---|
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.