[
https://issues.apache.org/jira/browse/HIVE-21052?focusedWorklogId=496724&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-496724
]
ASF GitHub Bot logged work on HIVE-21052:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Oct/20 16:17
Start Date: 07/Oct/20 16:17
Worklog Time Spent: 10m
Work Description: 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]
Issue Time Tracking
-------------------
Worklog Id: (was: 496724)
Time Spent: 6.5h (was: 6h 20m)
> Make sure transactions get cleaned if they are aborted before addPartitions
> is called
> -------------------------------------------------------------------------------------
>
> Key: HIVE-21052
> URL: https://issues.apache.org/jira/browse/HIVE-21052
> Project: Hive
> Issue Type: Bug
> Components: Transactions
> Affects Versions: 3.0.0, 3.1.1
> Reporter: Jaume M
> Assignee: Jaume M
> Priority: Critical
> Labels: pull-request-available
> Attachments: Aborted Txn w_Direct Write.pdf, HIVE-21052.1.patch,
> HIVE-21052.10.patch, HIVE-21052.11.patch, HIVE-21052.12.patch,
> HIVE-21052.2.patch, HIVE-21052.3.patch, HIVE-21052.4.patch,
> HIVE-21052.5.patch, HIVE-21052.6.patch, HIVE-21052.7.patch,
> HIVE-21052.8.patch, HIVE-21052.9.patch
>
> Time Spent: 6.5h
> Remaining Estimate: 0h
>
> If the transaction is aborted between openTxn and addPartitions and data has
> been written on the table the transaction manager will think it's an empty
> transaction and no cleaning will be done.
> This is currently an issue in the streaming API and in micromanaged tables.
> As proposed by [~ekoifman] this can be solved by:
> * Writing an entry with a special marker to TXN_COMPONENTS at openTxn and
> when addPartitions is called remove this entry from TXN_COMPONENTS and add
> the corresponding partition entry to TXN_COMPONENTS.
> * If the cleaner finds and entry with a special marker in TXN_COMPONENTS that
> specifies that a transaction was opened and it was aborted it must generate
> jobs for the worker for every possible partition available.
> cc [~ewohlstadter]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)