-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BIG-4969] Removing a bug in ByteArraySet chunk iteration #75
Conversation
860e663
to
e4162aa
Compare
555a7a9
to
555ea71
Compare
BIG-4969
0b6eb54
to
e8e36ca
Compare
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 work! left some suggestions to clean this up a bit
src/test/java/com/jwplayer/southpaw/SouthpawByteArraySetEndToEndTest.java
Outdated
Show resolved
Hide resolved
…er/southpaw into qlecorre-BIG-4969-51
…er/southpaw into qlecorre-BIG-4969-51
|
||
List<ByteArray> vals = getRandomByteArrays(size); | ||
|
||
for (ByteArray val: vals) { |
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.
Can be instantiated by the constructor rather than looping
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.
ByteArraySet cannot be instantiated with a List, but simplified with addAll
GOAL:
This pull request fixes a bug in the way we iterate over
ByteArraySet
chunks, which would cause data loss.The bug arises on serialization if the last value of one of the chunks was deleted. In this case, the iteration over chunks would terminate on that chunk, the ones after being lost. This is because we increment
currentOffset
without actually updatingcurrentChunk
, hence causing the subsequenthasNext()
to returnfalse
.The
testEmptyLastValueChunkIteratorBug()
test presents reproduction steps (in case you are interested).BUILDING BLOCKS:
Below are some branches and Docker images I created as par of the investigation:
Only Bytes:
Only Front Set:
Both Front Set and Bytes:
MANUAL DEBUGGING:
Use qlecorre-BIG-4969-51-local-debugging branch for debugging
BIG-4969