-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReadLedgerCommand can't get lastEntry when specifying the ledger rang… #4149
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
rerun failure checks |
1 similar comment
rerun failure checks |
@liubingxing Would you please help take a look at the failed tests? |
@hangc0276 Sorry, I didn't notice these failed tests, I will fix them as soon as possible. |
@hangc0276 |
rerun failure checks |
The test failed with timeout Lines 131 to 140 in a79a4e2
The failed log is
@liubingxing Please take a look, thanks. |
…e and bookie addr
5cfcca9
to
189a489
Compare
@hangc0276 Thanks for pointing out the error, I updated the code. Please review again. |
When we use the ReadLedgerCommand to read the ledger with entry range
bookkeeper shell readledger -l < ledgerId > -fe <firstEntryId> -le <lastEntryId>
This will return the entry in range [firstEntryId, lastEntryId].
If we specifying the bookie addr to read the ledger with entry range
bookkeeper shell readledger -b <bookieId> -l <ledgerId> -fe <firstEntryId> -le <lastEntryId>
It will return the entry in range [firstEntryId, lastEntryId) , the lastEntry is not included.
Because the LongStream.range will not include the lastEntry
![image](https://private-user-images.githubusercontent.com/2844826/288670866-42b68db8-e8d4-4aa8-b16c-841c570ffbe2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MzEwMzgsIm5iZiI6MTczOTUzMDczOCwicGF0aCI6Ii8yODQ0ODI2LzI4ODY3MDg2Ni00MmI2OGRiOC1lOGQ0LTRhYTgtYjE2Yy04NDFjNTcwZmZiZTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hB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NyakEsI15dEPa4f2420n0lGgmc)
We should replace LongStream.range with LongStream.rangeClosed
![image](https://private-user-images.githubusercontent.com/2844826/288670985-d1ae617a-0ba7-4b5e-9f15-bf8bcaebc9e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MzEwMzgsIm5iZiI6MTczOTUzMDczOCwicGF0aCI6Ii8yODQ0ODI2LzI4ODY3MDk4NS1kMWFlNjE3YS0wYmE3LTRiNWUtOWYxNS1iZjhiY2FlYmM5ZTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTA1ODU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjRiNDM4MjgzY2RlY2JhMDZjOGM4NTMzZWNhZDk1YWU0YjVkZWUwMDQwMDU4M2MyZWI5YTgwN2Q0MTNmOWIzNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.fr_A6AOW_Mcyy__A7Tm_rVcFpzfy9q24nCHVAg0GldY)