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 2021/05/27 01:25:19 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #10711: [Transaction] Fix transaction log handle managed ledger WriteFail state.

sijie commented on a change in pull request #10711:
URL: https://github.com/apache/pulsar/pull/10711#discussion_r640225117



##########
File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
##########
@@ -324,10 +324,10 @@ public void asyncOpen(final String name, final ManagedLedgerConfig config, final
             if (existingFuture.isDone()) {
                 try {
                     ManagedLedgerImpl l = existingFuture.get();
-                    if (l.getState().equals(State.Fenced.toString()) || l.getState().equals(State.Closed.toString())) {
+                    if (l.getState() == State.Fenced || l.getState() == State.Closed) {
                         // Managed ledger is in unusable state. Recreate it.
                         log.warn("[{}] Attempted to open ledger in {} state. Removing from the map to recreate it",
-                                name, l.getState());
+                                name, l.getState().toString());

Review comment:
       I don't think this change is needed.




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

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