deniskuzZ commented on a change in pull request #1415:
URL: https://github.com/apache/hive/pull/1415#discussion_r501141180
##########
File path:
standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -386,15 +427,27 @@ public void markCleaned(CompactionInfo info) throws
MetaException {
pStmt.setLong(paramCount++, info.highestWriteId);
}
LOG.debug("Going to execute update <" + s + ">");
- if (pStmt.executeUpdate() < 1) {
- LOG.error("Expected to remove at least one row from
completed_txn_components when " +
- "marking compaction entry as clean!");
+ if ((updCount = pStmt.executeUpdate()) < 1) {
+ // In the case of clean abort commit hasn't happened so
completed_txn_components hasn't been filled
+ if (!info.isCleanAbortedCompaction()) {
+ LOG.error(
+ "Expected to remove at least one row from
completed_txn_components when "
+ + "marking compaction entry as clean!");
+ }
}
s = "select distinct txn_id from TXNS, TXN_COMPONENTS where txn_id =
tc_txnid and txn_state = '" +
TXN_ABORTED + "' and tc_database = ? and tc_table = ?";
if (info.highestWriteId != 0) s += " and tc_writeid <= ?";
if (info.partName != null) s += " and tc_partition = ?";
+ if (info.writeIds != null && info.writeIds.size() > 0) {
+ String[] wriStr = new String[info.writeIds.size()];
+ int i = 0;
+ for (Long writeId: writeIds) {
+ wriStr[i++] = writeId.toString();
+ }
+ s += " and tc_writeid in (" + String.join(",", wriStr) + ")";
Review comment:
is this even used, statement was already compiled?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]