You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Denovo1998 (via GitHub)" <gi...@apache.org> on 2024/01/06 09:27:02 UTC

Re: [PR] [improve][broker] PIP-327: Support force topic loading for unrecoverable errors [pulsar]

Denovo1998 commented on code in PR #21759:
URL: https://github.com/apache/pulsar/pull/21759#discussion_r1443669539


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java:
##########
@@ -699,15 +705,19 @@ static class LocatorEntry {
         }
     }
 
-    public static Exception bkException(String operation, int rc, long ledgerId, long entryId) {
+    public static Exception bkException(String operation, int rc, long ledgerId, long entryId,
+            boolean forceRecovery) {
         String message = org.apache.bookkeeper.client.api.BKException.getMessage(rc)
                 + " -  ledger=" + ledgerId + " - operation=" + operation;
 
         if (entryId != -1) {
             message += " - entry=" + entryId;
         }
         boolean recoverable = rc != BKException.Code.NoSuchLedgerExistsException
-                && rc != BKException.Code.NoSuchEntryException;
+                && rc != BKException.Code.NoSuchEntryException
+                // if force-recovery is enabled then made it non-recoverable exception
+                // and force schema to skip this exception and recover immediately
+                && !forceRecovery;

Review Comment:
   Only for this part of the schema. I had a pr(https://github.com/apache/pulsar/pull/20415) attempt to fix this "unrecoverable errors". The implementation method in PR has not been discussed, but the function should be regarded as completed. So if we have a way to make up for the missing schema, maybe we don't need to skip the "unrecoverable errors" in this part of the schema.



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