You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/24 14:06:23 UTC

[GitHub] [pulsar] liangyepianzhou commented on a change in pull request #14218: [Transaction] Don`t wait When commit or abort

liangyepianzhou commented on a change in pull request #14218:
URL: https://github.com/apache/pulsar/pull/14218#discussion_r813911704



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java
##########
@@ -269,11 +250,18 @@ public TxnID getTxnID() {
                 + state.name() + ", expect " + State.OPEN + " state!"));
     }
 
+    public synchronized void registerSendOp(CompletableFuture<MessageId> newSendFuture) {
+        sendFuture = sendFuture.thenCompose(ignore -> newSendFuture);
+    }
+
+    public synchronized void registerAckOp(CompletableFuture<Void> newAckFuture) {
+        ackFuture = ackFuture.thenCompose(ignore -> newAckFuture);
+    }
 
-    private CompletableFuture<Void> allOpComplete() {
+    public CompletableFuture<Void> prepareCommit() {

Review comment:
       This is really an important point, thanks a lot for the reminder. I have made optimizations, what do you think about this change? 




-- 
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