Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-12725

CompactionTxnHandler.findNextToCompact() may produce "Operation not allowed after ResultSet closed"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.0, 2.0.0
    • 1.3.0, 2.1.0
    • Transactions
    • None

    Description

      2015-12-21 22:34:55,427 ERROR txn.CompactionTxnHandler (CompactionTxnHandler.java:findNextToCompact(210)) - [pre-prod-poc-4.novalocal-41] Unable to select next element for \
      compaction, Operation not allowed after ResultSet closed
      2015-12-21 22:34:55,431 ERROR compactor.Worker (Worker.java:run(181)) - [pre-prod-poc-4.novalocal-41] Caught an exception in the main loop of compactor worker pre-prod-poc-\
      4.novalocal-41, MetaException(message:Unable to connect to transaction database java.sql.SQLException: Operation not allowed after ResultSet closed
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
              at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:794)
              at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7139)
              at org.apache.hadoop.hive.metastore.txn.CompactionTxnHandler.findNextToCompact(CompactionTxnHandler.java:206)
              at org.apache.hadoop.hive.ql.txn.compactor.Worker.run(Worker.java:81)
      )
              at org.apache.hadoop.hive.metastore.txn.CompactionTxnHandler.findNextToCompact(CompactionTxnHandler.java:214)
              at org.apache.hadoop.hive.ql.txn.compactor.Worker.run(Worker.java:81)
      

      https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html

      int updCount = stmt.executeUpdate(s);
                if(updCount == 1) {
                  dbConn.commit();
                  return info;
                }
                if(updCount == 0) {
                  LOG.debug("Another Worker picked up " + info);
                  continue;
                }
      

      executeUpdate() closes the RS and if competing Worker "steals" the item then updCount == 0 is true...

      Attachments

        Issue Links

          Activity

            People

              ekoifman Eugene Koifman
              ekoifman Eugene Koifman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: