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


##########
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:
   Recently, we found this method will be helpful in some cases where the 
caller needs to wait for the transaction buffer to recover completely. For 
example, in https://github.com/apache/pulsar/pull/21466, the persistent topic 
needs to wait for the transaction buffer to recover completely and then get the 
max read position.
   
   But the method signature is deprecated because the param `boolean isTxn` is 
useless. We remove this method and replace it with a new method  
`CompletableFuture<Void> checkIfTBRecoverCompletely()`.
   But I have a concern about this, we provide `TransactionBufferProvider` for 
the users to implement a custom version based on the `TransactionBuffer` 
interface. Will this change impact these users?



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