Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-10504

Db migration #1908 is stuck on Oracle when upgrading to 7.0+

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0
    • Fix Version/s: 7.1
    • Component/s: Database
    • Labels:
      None

      Description

      When upgrading an Oracle database to 7.0, the migration #1908 may be stuck during dozens of hours:

       
      2018.03.16 10:20:57 INFO  web[][DbMigrations] #1908 'Delete person and file measures'...
      2018.03.16 10:21:57 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 249 snapshots processed (4 items/sec)
      2018.03.16 10:22:57 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 249 snapshots processed (0 items/sec)
      ...
      2018.03.16 14:07:57 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 499 snapshots processed (0 items/sec)
      

      It may also fail with a rollback segment error:

      2018.03.21 00:58:57 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 4499 snapshots processed (0 items/sec)
      2018.03.21 00:59:02 ERROR web[][DbMigrations] #1908 'Delete person and file measures': failure | time=51364744ms
      2018.03.21 00:59:02 ERROR web[][DbMigrations] Executed DB migrations: failure | time=51850733ms
      2018.03.21 00:59:02 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=51850840ms
      2018.03.21 00:59:02 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
      org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1908 'Delete person and file measures' failed
      	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
      	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
      	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl$$Lambda$766/1232581341.accept(Unknown Source)
      	at java.util.Iterator.forEachRemaining(Iterator.java:116)
      	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      	at java.util.stream.ReferencePipeline$Head.forEachOrdered(ReferencePipeline.java:590)
      	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
      	at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:50)
      	at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
      	at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
      	at org.sonar.server.platform.db.migration.DatabaseMigrationImpl$$Lambda$761/181637336.run(Unknown Source)
      	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: java.lang.IllegalStateException: Error during processing of row: [uuid=AVvYYu623bqIPwjXmQ7z]
      	at org.sonar.server.platform.db.migration.step.SelectImpl.newExceptionWithRowDetails(SelectImpl.java:89)
      	at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:81)
      	at org.sonar.server.platform.db.migration.step.MassUpdate.execute(MassUpdate.java:91)
      	at org.sonar.server.platform.db.migration.version.v70.DeletePersonAndFileMeasures.execute(DeletePersonAndFileMeasures.java:54)
      	at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:44)
      	at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
      	... 13 common frames omitted
      Caused by: java.sql.SQLException: ORA-01555: snapshot too old: rollback segment number 7 with name "_SYSSMU7_4288322936$" too small
      
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
      	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
      	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
      	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
      	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:225)
      	at oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1066)
      	at oracle.jdbc.driver.OracleStatement.fetchMoreRows(OracleStatement.java:3716)
      	at oracle.jdbc.driver.InsensitiveScrollableResultSet.fetchMoreRows(InsensitiveScrollableResultSet.java:1015)
      	at oracle.jdbc.driver.InsensitiveScrollableResultSet.absoluteInternal(InsensitiveScrollableResultSet.java:979)
      	at oracle.jdbc.driver.InsensitiveScrollableResultSet.next(InsensitiveScrollableResultSet.java:579)
      	at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
      	at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207)
      	at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:77)
      	... 17 common frames omitted
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              simon.brandhof Simon Brandhof (Inactive)
              Reporter:
              simon.brandhof Simon Brandhof (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: