Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22942 Replace PTest with an alternative
  3. HIVE-23630

TestTxnHandler#allocateNextWriteIdRetriesAfterDetectingConflictingConcurrentInsert is unstable

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      I think I've seen this exception but it seems to be coming from this testcase more frequently

      java.lang.RuntimeException: MetaException(message:Unable to update transaction database org.apache.derby.shared.common.error.DerbySQLIntegrityConstraintViolationException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'NEXT_WRITE_ID_IDX' defined on 'NEXT_WRITE_ID'.
       at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
       at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
       at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
       at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
       at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
       at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
       at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
       at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
       at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
       at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
       at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
       at org.apache.hadoop.hive.metastore.txn.TxnHandler.allocateTableWriteIds(TxnHandler.java:2074)
       at org.apache.hadoop.hive.metastore.txn.TestTxnHandler.lambda$allocateNextWriteIdRetriesAfterDetectingConflictingConcurrentInsert$1(TestTxnHandler.java:1780)
       at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
       at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1596)
       at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
       at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
       at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
       at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
      Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'NEXT_WRITE_ID_IDX' defined on 'NEXT_WRITE_ID'.
       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
       at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
       at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
       at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
       at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
       at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
       at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
       at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
       at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
       at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
       at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
       ... 13 more
      

        Attachments

        1. HIVE-23630.1.patch
          2 kB
          Marton Bod

          Issue Links

            Activity

              People

              • Assignee:
                Marton Bod Marton Bod
                Reporter:
                kgyrtkirk Zoltan Haindrich
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m