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



##########
File path: 
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java
##########
@@ -87,94 +87,109 @@ public MLTransactionMetadataStore(TransactionCoordinatorID 
tcID,
         this.abortedTransactionCount = new LongAdder();
         this.transactionTimeoutCount = new LongAdder();
         this.appendLogCount = new LongAdder();
+    }
 
+    public CompletableFuture<TransactionMetadataStore> 
init(TransactionRecoverTracker recoverTracker) {
+        CompletableFuture<TransactionMetadataStore> completableFuture = new 
CompletableFuture<>();
         if (!changeToInitializingState()) {
             log.error("Managed ledger transaction metadata store change state 
error when init it");
-            return;
-        }
-        new Thread(() -> transactionLog.replayAsync(new 
TransactionLogReplayCallback() {
-
-            @Override
-            public void replayComplete() {
-                recoverTracker.appendOpenTransactionToTimeoutTracker();
-                if (!changeToReadyState()) {
-                    log.error("Managed ledger transaction metadata store 
change state error when replay complete");
-                } else {
-                    recoverTracker.handleCommittingAndAbortingTransaction();
-                    timeoutTracker.start();
+            completableFuture
+                    .completeExceptionally(new 
TransactionCoordinatorClientException
+                    .CoordinatorNotFoundException("transaction metadata store 
with tcId "
+                            + tcID.toString() + " change state to Initializing 
error when init it"));
+        } else {
+            new Thread(() -> transactionLog.replayAsync(new 
TransactionLogReplayCallback() {

Review comment:
       1. We have used this thread pool in TB. We don't want TB and TC to use 
the same thread pool at the same time.
   
   2. The optimization of TC is temporarily slowed down, and the optimization 
will be carried out after the correction of APi is completed. 
   




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