Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -659,24 +660,28 @@ public void finishTransaction(long transactionId, Set<Long> errorReplicaIds) thr
db.writeLock();
try {
boolean hasError = false;
for (TableCommitInfo tableCommitInfo : transactionState.getIdToTableCommitInfos().values()) {
Iterator<TableCommitInfo> tableCommitInfoIterator = transactionState.getIdToTableCommitInfos().values().iterator();
while (tableCommitInfoIterator.hasNext()) {
TableCommitInfo tableCommitInfo = tableCommitInfoIterator.next();
long tableId = tableCommitInfo.getTableId();
OlapTable table = (OlapTable) db.getTable(tableId);
// table maybe dropped between commit and publish, ignore this error
if (table == null) {
transactionState.removeTable(tableId);
tableCommitInfoIterator.remove();
LOG.warn("table {} is dropped, skip version check and remove it from transaction state {}",
tableId,
transactionState);
continue;
}
PartitionInfo partitionInfo = table.getPartitionInfo();
for (PartitionCommitInfo partitionCommitInfo : tableCommitInfo.getIdToPartitionCommitInfo().values()) {
Iterator<PartitionCommitInfo> partitionCommitInfoIterator = tableCommitInfo.getIdToPartitionCommitInfo().values().iterator();
while (partitionCommitInfoIterator.hasNext()) {
PartitionCommitInfo partitionCommitInfo = partitionCommitInfoIterator.next();
long partitionId = partitionCommitInfo.getPartitionId();
Partition partition = table.getPartition(partitionId);
// partition maybe dropped between commit and publish version, ignore this error
if (partition == null) {
tableCommitInfo.removePartition(partitionId);
partitionCommitInfoIterator.remove();
LOG.warn("partition {} is dropped, skip version check and remove it from transaction state {}",
partitionId,
transactionState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ private void publishVersion() throws UserException {
}

if (shouldFinishTxn) {
globalTransactionMgr.finishTransaction(transactionState.getDbId(), transactionState.getTransactionId(), publishErrorReplicaIds);
try {
// one transaction exception should not affect other transaction
globalTransactionMgr.finishTransaction(transactionState.getDbId(), transactionState.getTransactionId(), publishErrorReplicaIds);
} catch (Exception e) {
LOG.warn("error happends when finish transaction {} ", transactionState.getTransactionId(), e);
}
if (transactionState.getTransactionStatus() != TransactionStatus.VISIBLE) {
// if finish transaction state failed, then update publish version time, should check
// to finish after some interval
Expand Down