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

High CPU Usage caused by Ancestors Check when CONFANCESTORS table is corrupted

    XMLWordPrintable

Details

    Description

      Summary

      Corrupted entries in the application Ancestors Table (responsible for maintaining the relationship in between parent and descendant pages on Confluence) can cause View Page threads to run for a long period, triggering symptoms like High CPU Usage and intense GC Activity.

      Symptoms & Diagnosis

      This problem is triggered regardless of environmental variables, but its symptoms are usually the following:

      • High CPU Usage.
      • Garbage Collection Threads being heavily used.

      Also, it is important to diagnose if there are corrupted entries in the Ancestors Table or not, since those are known to cause this issue.

      In order to diagnose if there are indeed corrupted entries in the Ancestors Table, an administrator may run the query below at Confluence's database:

      SELECT A.ANCESTORID, A.DESCENDENTID, COUNT(A.DESCENDENTID)
      FROM CONFANCESTORS A, CONTENT B
      WHERE B.CONTENTID = A.DESCENDENTID
      GROUP BY A.ANCESTORID, A.DESCENDENTID HAVING COUNT(A.DESCENDENTID) != 1
      ORDER BY 3 DESC
      

      If any results are returned, the CONFANCESTORS table is corrupt and needs to be rebuilt.

      Cause

      This is caused by corrupted entries in the application Ancestors Table - Responsible for maintaining the relationship in between parent and descendant pages on Confluence.

      Thread dump example

      Thread Dumps will usually show that the offending threads are executing the getInheritedContentPermissionSets (accountable for checking permissions) method being executed:

      "http-nio-8090-exec-20 uri:/pages/viewpage.action username:john.smith" #274 daemon prio=5 os_prio=0 tid=0x00007f6484011000 nid=0x2e8b runnable [0x00007f61c350f000]
         java.lang.Thread.State: RUNNABLE
      	at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:67)
      	at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36)
      	at net.sf.hibernate.impl.SessionImpl.isUpdateNecessary(SessionImpl.java:2666)
      	at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2581)
      	at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2513)
      	at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2308)
      	at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1831)
      	at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1594)
      	at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1559)
      	at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49)
      	at com.atlassian.confluence.security.persistence.dao.hibernate.HibernateContentPermissionSetDao.lambda$getInheritedContentPermissionSets$0(HibernateContentPermissionSetDao.java:38)
      	at com.atlassian.confluence.security.persistence.dao.hibernate.HibernateContentPermissionSetDao$$Lambda$766/775792763.doInHibernate(Unknown Source)
      	at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
      	at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341)
      	at com.atlassian.confluence.security.persistence.dao.hibernate.HibernateContentPermissionSetDao.getInheritedContentPermissionSets(HibernateContentPermissionSetDao.java:25)
      ...
      

      Workaround

      The workaround consists of re-constructing the application Ancestors Table as described in Rebuilding the Ancestor Table documentation:

      1. Back up your database.
      2. Use the following URL to access the Page Level Permissions page: <base-url>/admin/permissions/pagepermsadmin.action
      3. Choose Rebuild ancestor table.
      4. Go to > General Configuration > Cache Management.
      5. Flush the Inherited Content Permissions cache (only).

      You may also need to rebuild the content index so that the permissions take effect in search results.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jwyllys Justin W.
              Votes:
              3 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: