codelipenghui commented on code in PR #21406:
URL: https://github.com/apache/pulsar/pull/21406#discussion_r1374196443


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/TransactionBuffer.java:
##########
@@ -188,14 +188,14 @@ public interface TransactionBuffer {
     TransactionBufferStats getStats(boolean lowWaterMarks);
 
     /**
-     * Wait TransactionBuffer Recovers completely.
-     * Take snapshot after TB Recovers completely.
+     * Wait TransactionBuffer recovers completely.
      * @param isTxn
-     * @return a future which has completely if isTxn = false. Or a future 
return by takeSnapshot.
+     * @return a future whether the transaction buffer recover completely.
      */
-    CompletableFuture<Void> checkIfTBRecoverCompletely(boolean isTxn);
-
-
+    @Deprecated
+    default CompletableFuture<Void> checkIfTBRecoverCompletely(boolean isTxn) {
+        return CompletableFuture.completedFuture(null);
+    }

Review Comment:
   Same as the above comment.



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:
##########
@@ -255,6 +230,40 @@ public long getCommittedTxnCount() {
 
     @Override
     public CompletableFuture<Position> appendBufferToTxn(TxnID txnId, long 
sequenceId, ByteBuf buffer) {
+        buffer.retain();
+        return transactionBufferFuture.thenCompose(ignore -> {

Review Comment:
   Will it break the order of the request? 
   
   If you requested 1,2,3
   But after the transactionBufferFuture completed, it will execute as 3,2,1
   
   It should be a problem, right?



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -712,6 +712,7 @@ public CompletableFuture<Optional<Long>> 
addProducer(Producer producer,
     }
 
     @Override
+    @Deprecated

Review Comment:
   I think we can remove it directly. I don't think any other component will 
call this method except transactions.



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

Reply via email to