thetumbled commented on code in PR #19662:
URL: https://github.com/apache/pulsar/pull/19662#discussion_r1127563479
##########
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:
Not completed, i will ping you when finished.
--
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]