hangc0276 commented on code in PR #4220:
URL: https://github.com/apache/bookkeeper/pull/4220#discussion_r1501993211


##########
bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchReadThroughputLatency.java:
##########
@@ -102,14 +102,14 @@ private static void readLedger(ClientConfiguration conf, 
long ledgerId, byte[] p
                 }
                 long starttime = System.nanoTime();
 
-                while (entriesRead <= lastConfirmed) {
+                while (entriesRead < lastConfirmed) {
                     long nextLimit = lastRead + 100000;
                     Enumeration<LedgerEntry> entries;
                     if (batchEntries <= 0) {
                         long readTo = Math.min(nextLimit, lastConfirmed);
                         entries = lh.readEntries(lastRead + 1, readTo);
                     } else {
-                        entries = lh.batchReadEntries(lastRead, batchEntries, 
-1);
+                        entries = lh.batchReadEntries(lastRead + 1, 
batchEntries, -1);

Review Comment:
   Do we need init the `lastRead` to `-1` instead of `0`, otherwise the entry 
`0` can't be read



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