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


##########
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:
   as I mentioned it’s very tricky and not possible to conclude non-recoverable 
errors. For example, the broker can not differentiate between all the ensemble 
bookies of the ledgers that are temporarily unavailable or are permanently 
removed from the cluster without graceful recovery.
   So, if you always ignore recoverable schema ledgers then it means we lose 
schema metadata even though ledgers were recoverable. so, it's better to 
control it with flag and ignore them only if it necessary.



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