You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "thetumbled (via GitHub)" <gi...@apache.org> on 2023/03/02 01:57:20 UTC

[GitHub] [pulsar] thetumbled commented on a diff in pull request #19662: [fix][txn] The second commit of same transaction will fail

thetumbled commented on code in PR #19662:
URL: https://github.com/apache/pulsar/pull/19662#discussion_r1122521829


##########
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java:
##########
@@ -400,6 +400,10 @@ public CompletableFuture<Void> updateTxnStatus(TxnID txnID, TxnStatus newStatus,
                             appendLogCount.increment();
                             try {
                                 synchronized (txnMetaListPair.getLeft()) {
+                                    if (txnMetaListPair.getLeft().status() == newStatus) {

Review Comment:
   for 2:  Lines 385 to 388 can't avoid race condition, so i check the state status in synchronized block.
   for 3: this can be fixed easily, we just delete the duplicate transaction logs.
   ```
   transactionLog.deletePosition(Collections.singletonList(position));
   ```



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org