gaoran10 commented on a change in pull request #10095:
URL: https://github.com/apache/pulsar/pull/10095#discussion_r604668365
##########
File path:
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/NonDurableCursorImpl.java
##########
@@ -40,7 +40,8 @@
// Compare with "latest" position marker by using only the ledger id.
Since the C++ client is using 48bits to
// store the entryId, it's not able to pass a Long.max() as entryId.
In this case there's no point to require
// both ledgerId and entryId to be Long.max()
- if (startCursorPosition == null || startCursorPosition.getLedgerId()
== PositionImpl.latest.getLedgerId()) {
+ if (startCursorPosition == null || startCursorPosition.getLedgerId()
== PositionImpl.latest.getLedgerId()
+ || startCursorPosition.compareTo(ledger.lastConfirmedEntry) >
0) {
Review comment:
It seems that the condition
`startCursorPosition.compareTo(ledger.lastConfirmedEntry) > 0` already cover
the condition `startCursorPosition.getLedgerId() ==
PositionImpl.latest.getLedgerId()`, so compare with `ledger.lastConfirmedEntry`
is enough?
--
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:
[email protected]