congbobo184 commented on code in PR #19662:
URL: https://github.com/apache/pulsar/pull/19662#discussion_r1127540877
##########
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java:
##########
@@ -415,7 +426,7 @@ public CompletableFuture<Void> updateTxnStatus(TxnID txnID,
TxnStatus newStatus,
} else {
abortedTransactionCount.increment();
}
- txnMetaMap.remove(txnID.getLeastSigBits());
+ //
txnMetaMap.remove(txnID.getLeastSigBits());
Review Comment:
why delete this line?
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/TransactionMetadataStoreService.java:
##########
@@ -394,21 +402,32 @@ public void handleOpFail(Throwable e,
TransactionCoordinatorID tcId) {
}
}
+ // after the completion of txn end, remove txnMeta.
+ public void removeTxnMeta(TxnID txnID) {
+ TransactionCoordinatorID tcId = getTcIdFromTxnId(txnID);
+ TransactionMetadataStore store = stores.get(tcId);
+ store.removeTxnMeta(txnID.getLeastSigBits());
+ }
+
public void endTransactionForTimeout(TxnID txnID) {
getTxnMeta(txnID).thenCompose(txnMeta -> {
if (txnMeta.status() == TxnStatus.OPEN) {
- return endTransaction(txnID, TxnAction.ABORT_VALUE, true);
+ return endTransaction(txnID, TxnAction.ABORT_VALUE, true)
+ .thenRun(() -> removeTxnMeta(txnID));
} else {
+ removeTxnMeta(txnID);
Review Comment:
the transaction status can be in committing status, why we need to remove
TxnMeta?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]