bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

[bookie-shell] fix readLedger with parameter -bookie and -ledgerid can not read any entries in ledger

Open TakaHiR07 opened this issue 2 years ago • 4 comments

Motivation

If we use bookieshell readLedger only with parameter -ledgerid, we can read all entries in this ledger, but if use with parameter -ledgerid and --bookie, we cant read any entries.

This is because it try to reverse entries from firstentry(default 0) to lastEntry(default -1). Therefore it would directly finish without read any entries, misleading us that ledgerId in our selected bookie has no entry.

Changes

when set -ledgerid and -bookie and not set -entry, continue to read next entry until get BKNoSuchEntryException

TakaHiR07 avatar Mar 17 '23 10:03 TakaHiR07

@TakaHiR07 Are you still working on this?

hezhangjian avatar Apr 28 '24 09:04 hezhangjian

@TakaHiR07 Are you still working on this?

Sorry for forget this work. If needing, I can finish this in a few day.

TakaHiR07 avatar Apr 29 '24 02:04 TakaHiR07

@TakaHiR07 Thanks for your contribution, I want to move this forward in the next release.

hezhangjian avatar May 12 '24 00:05 hezhangjian

Can we add some tests?

@shoothzj @horizonzy Have done. Can you help review again. Thx

TakaHiR07 avatar May 14 '24 03:05 TakaHiR07