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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes for index upgrade from PTable V1 to V2 or later #1504

Merged
merged 1 commit into from Dec 4, 2017

Conversation

2 participants
@shaan1337
Member

shaan1337 commented Dec 1, 2017

Thanks to @lscpike for finding these bugs 馃憤

i) Bugfix that may cause PTable enumeration to end earlier when upgrading hashes (failing test provided by @lscpike in #1501):

If an empty list is returned in ReadUntilDifferentHashes(), the list enumerator in MoveNext() will return false and PTable enumeration will stop earlier than it should.

ii) Bugfix that may cause PTable entries with collision to become out of order (test added in table_index_hash_collision_when_upgrading_to_64bit):
The last IndexEntry in the list returned by ReadUntilDifferentHashes() corresponds to the next stream hash group. Thus, that IndexEntry will be returned earlier during enumeration and will be merged earlier.
If that IndexEntry corresponds to a stream hash which has collisions, it might not be at the correct position after merge (if it should be later in the file after sorting index entries)

@shaan1337 shaan1337 changed the title from Bugfixes for index upgrade from PTable Version 1 to V2 or later to Bugfixes for index upgrade from PTable V1 to V2 or later Dec 1, 2017

i) Bugfix that may cause PTable enumeration to end earlier when upgra鈥
鈥ing hashes (test provided by @lscpike):

If an empty list is returned in ReadUntilDifferentHashes(), the list enumerator in MoveNext() will return false and PTable enumeration will stop earlier than it should.

ii) Bugfix that may cause PTable entries with collision to become out of order (test added):
The last IndexEntry in the list returned by ReadUntilDifferentHashes() corresponds to the next stream hash group
Thus, that IndexEntry will be returned earlier during enumeration and will be merged earlier.
If that IndexEntry corresponds to a stream hash which has collisions, it might not be at the correct position (if it should be later in the file after sorting index entries)

@hayley-jean hayley-jean merged commit 3ed8815 into release-v4.0.4 Dec 4, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
wercker/build-mono4 Wercker pipeline passed
Details

@hayley-jean hayley-jean deleted the fix-index-enumerator-bug branch Dec 4, 2017

hayley-jean added a commit that referenced this pull request Dec 4, 2017

Merge pull request #1504 from EventStore/fix-index-enumerator-bug
Bugfixes for index upgrade from PTable V1 to V2 or later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment