Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-15128

Lexorank Integrity Healthcheck Fails Due To "BUCKET" Column

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Low
    • None
    • 7.1.6, 7.1.7, 7.4.1
    • None

    Description

      Summary

      JIRA allows downgrading of backups on imports, however relies on downgrade tasks to be implemented. In JIRA Software 7.2 the LexoRank field is split into multiple fields and there is not a downgrade task for this. Due to that LexoRank will have problems if downgraded, for example Lexorank Integrity healthcheck fails even though the minimum and maximum markers are present and are correct in the database.

      Environment

      JIRA 7.1.x

      Steps to Reproduce

      Generate a backup from any 7.2.x Server and restore it to 7.1.6 Server

      Expected Results

      The LexoRank field should be downgraded back to the previous state, leading to the Lexorank integrity healthcheck status being normal and tasks working as expected.

      Actual Results

      Lexorank integrity healthcheck fails as the BUCKET field is present.

      Maximum/minimum markers are present and correct in database. No duplicate marker values.

      The below exception is thrown in the atlassian-jira.log file:

      2016-10-27 20:47:16,978 http-nio-8080-exec-9 ERROR admin 1247x833x1 16ebkcn 00.000.000.000 /secure/QuickCreateIssue.jspa [c.a.g.service.lexorank.LexoRankIssueEventListener] Expected the first rank row to be of type MAXIMUM_MARKER_ROW. Found row[LexoRankRow{id=10000, fieldId=0, issueId=8, lockHash='9223372036854775807', lockTime=null, rank='null', type=MINIMUM_MARKER_ROW}]
      com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException: Expected the first rank row to be of type MAXIMUM_MARKER_ROW. Found row[LexoRankRow{id=10000, fieldId=0, issueId=8, lockHash='9223372036854775807', lockTime=null, rank='null', type=MINIMUM_MARKER_ROW}]
          at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.getMaximumMarkerRowAndPreviousRow(LexoRankDaoImpl.java:373)
          at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.rankInitially(LexoRankOperation.java:167)
          at com.atlassian.greenhopper.service.lexorank.LexoRankOperation.execute(LexoRankOperation.java:110)
          at com.atlassian.greenhopper.manager.lexorank.LexoRankManagerImpl.performRankOperation(LexoRankManagerImpl.java:286)
          at com.atlassian.greenhopper.manager.lexorank.LexoRankManagerImpl.getRankOrRankInitially(LexoRankManagerImpl.java:86)
          at com.atlassian.greenhopper.service.lexorank.LexoRankIssueEventListener.doOnIssueEvent(LexoRankIssueEventListener.java:43)
          at com.atlassian.greenhopper.service.issue.AbstractIssueEventListener.onIssueEvent(AbstractIssueEventListener.java:38)
          ... 2 filtered

       
      or

      2016-11-17 16:06:30,172 lexorank-executor-thread-0 ERROR      [c.a.g.s.lexorank.balance.LexoRankBalancingService] org.postgresql.util.PSQLException: Bad value for type int : 0|000000:
      com.atlassian.jira.exception.DataAccessException: org.postgresql.util.PSQLException: Bad value for type int : 0|000000:
      	at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.find(LexoRankDaoImpl.java:1236)
      	at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.findMinimumMarkerRow(LexoRankDaoImpl.java:263)
      	at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.getMinimumMarkerRow(LexoRankDaoImpl.java:282)
      	at com.atlassian.greenhopper.service.lexorank.balance.LexoRankBalancer.balanceFieldId(LexoRankBalancer.java:209)
      	at com.atlassian.greenhopper.service.lexorank.balance.LexoRankBalancer.balanceFieldIds(LexoRankBalancer.java:106)
      	at com.atlassian.greenhopper.service.lexorank.balance.LexoRankScheduledBalanceHandler.run(LexoRankScheduledBalanceHandler.java:60)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.postgresql.util.PSQLException: Bad value for type int : 0|000000:
      	at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2747)
      	at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:1991)
      	at org.apache.commons.dbcp2.DelegatingResultSet.getInt(DelegatingResultSet.java:215)
      	at org.apache.commons.dbcp2.DelegatingResultSet.getInt(DelegatingResultSet.java:215)
      	at com.atlassian.greenhopper.manager.lexorank.LexoRankDaoImpl.getLexoRankRows(LexoRankDaoImpl.java:1255)

       

       

      Notice the values of the columns (in the error message) are not referring to the actual value shown in the database query output screenshot above: id, fieldId, issueId, lockHash, lockTime, rank and type.

      Notes

      When importing from a higher version the downgrade tasks are not executed on the data. We should either block importing or downgrade the field.

      Workaround

      Take a database dump and remove the BUCKET column which is not supposed to exist in 7.1.x

      1. Stop JIRA.
      2. Execute the below:
        ALTER TABLE "AO_60DB71_LEXORANK" DROP COLUMN "BUCKET";
        
      3. Start JIRA
      4. run the LexoRank integrity checks.

      or related KB https://confluence.atlassian.com/jirakb/lexorank-integrity-healthcheck-fails-due-to-bucket-column-858576846.html

      Attachments

        1. db.png
          db.png
          9 kB
        2. healthcheck.png
          healthcheck.png
          78 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tchai Tzu Hau Chai (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: