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 2022/04/10 09:06:05 UTC

[GitHub] [pulsar] Jason918 commented on a diff in pull request #15098: [fix][broker] patch #5809: Fix the ledgerID not found cause NPE.

Jason918 commented on code in PR #15098:
URL: https://github.com/apache/pulsar/pull/15098#discussion_r846744916


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -2230,9 +2236,8 @@ void updateCursor(ManagedCursorImpl cursor, PositionImpl newPosition) {
     PositionImpl startReadOperationOnLedger(PositionImpl position, OpReadEntry opReadEntry) {
         Long ledgerId = ledgers.ceilingKey(position.getLedgerId());
         if (null == ledgerId) {
-            opReadEntry.readEntriesFailed(new ManagedLedgerException.NoMoreEntriesToReadException("The ceilingKey(K key"
-                    + ") method is used to return the least key greater than or equal to the given key, "
-                    + "or null if there is no such key"), null);
+            opReadEntry.makeInvalid();

Review Comment:
   This changes the behavior of the method. So we need to go through all the usage of this method.
   As far as I can see, 
   1. This line makes no sense any more. https://github.com/apache/pulsar/blob/a242f03f69791fcfa1934b6cab20689393228381/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java#L142
   2. Also affects the `OpReadEntry.create` in https://github.com/apache/pulsar/blob/5cf3fa0d8050b16305ee060820b884d69ec8a828/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L765
   
   
   



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