Skip to content

Commit

Permalink
Optimization Logic
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 4f84a48 commit 07ca645
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1207,13 +1207,7 @@ public void finishTransaction(long transactionId, Set<Long> errorReplicaIds) thr
finishSpan.end();
}

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

resetTransactionStateTabletCommitInfos(transactionState);
transactionState.notifyVisible();
// do after transaction finish
GlobalStateMgr.getCurrentState().getOperationListenerBus().onStreamJobTransactionFinish(transactionState);
Expand Down Expand Up @@ -1914,13 +1908,7 @@ public void finishTransactionNew(TransactionState transactionState, Set<Long> pu
finishSpan.end();
}

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

resetTransactionStateTabletCommitInfos(transactionState);
// do after transaction finish
GlobalStateMgr.getCurrentState().getOperationListenerBus().onStreamJobTransactionFinish(transactionState);
GlobalStateMgr.getCurrentState().getLocalMetastore().handleMVRepair(transactionState);
Expand Down Expand Up @@ -2082,4 +2070,13 @@ public List<Object> getSamplesForMemoryTracker() {
readUnlock();
}
}

public void resetTransactionStateTabletCommitInfos(TransactionState transactionState) {
writeLock();
try {
transactionState.resetTabletCommitInfos();
} finally {
writeUnlock();
}
}
}

0 comments on commit 07ca645

Please sign in to comment.