Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: edwinhzhang <[email protected]>
  • Loading branch information
zhangheihei committed Nov 28, 2024
1 parent 37e768e commit 4f84a48
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,6 @@ public void finishTransaction(long transactionId, Set<Long> errorReplicaIds) thr
transactionState.clearErrorMsg();
transactionState.setTransactionStatus(TransactionStatus.VISIBLE);
unprotectUpsertTransactionState(transactionState, false);
transactionState.resetTabletCommitInfos();
txnOperated = true;
// TODO(cmy): We found a very strange problem. When delete-related transactions are processed here,
// subsequent `updateCatalogAfterVisible()` is called, but it does not seem to be executed here
Expand Down Expand Up @@ -1208,6 +1207,13 @@ public void finishTransaction(long transactionId, Set<Long> errorReplicaIds) thr
finishSpan.end();
}

writeLock();
try {
transactionState.resetTabletCommitInfos();
} finally {
writeUnlock();
}

transactionState.notifyVisible();
// do after transaction finish
GlobalStateMgr.getCurrentState().getOperationListenerBus().onStreamJobTransactionFinish(transactionState);
Expand Down Expand Up @@ -1886,7 +1892,6 @@ public void finishTransactionNew(TransactionState transactionState, Set<Long> pu
transactionState.setNewFinish();
transactionState.setTransactionStatus(TransactionStatus.VISIBLE);
unprotectUpsertTransactionState(transactionState, false);
transactionState.resetTabletCommitInfos();
transactionState.notifyVisible();
txnOperated = true;
} finally {
Expand All @@ -1909,6 +1914,13 @@ public void finishTransactionNew(TransactionState transactionState, Set<Long> pu
finishSpan.end();
}

writeLock();
try {
transactionState.resetTabletCommitInfos();
} finally {
writeUnlock();
}

// do after transaction finish
GlobalStateMgr.getCurrentState().getOperationListenerBus().onStreamJobTransactionFinish(transactionState);
GlobalStateMgr.getCurrentState().getLocalMetastore().handleMVRepair(transactionState);
Expand Down

0 comments on commit 4f84a48

Please sign in to comment.