Repository navigation
Compare index values at one method, across their representations - #1331
Merged
Merged
Conversation
A page read back from disk holds its values as byte arrays, a page written in this image and a journal entry hold SoilObjectIds, and the two are never equal. Four places compared them with #= and failed after a reopen: - SoilIndexItemsPage>>#itemIndexForKey:value: and SoilSkipListIterator>>#findPageFor:value: - #removeKey:value: went into its absent block for an entry that is there, and adding a pair the index held appended a second entry for it, in a running database and in a replay. - SoilAbstractBTreeDataPage>>#findItem:with: - the same miss, and the walk did not stop at the first page, so it read page 0 and failed on the stream position. - SoilRemoveKeyEntry>>#isForItem:index: - a reader older than a removal lost the key, on unique indexes too. All of them, and SoilAddKeyEntry>>#isForItem:index:, now ask SoilIndexItemsPage class>>#value:matches:. Across representations the bytes decide; within one, #= does, because an object id without an index yet (a new object before commit) only matches itself - as bytes all of them would look the same and a second new value under a key would overwrite the first. Carries the red test of duplicate-key-remove-after-reopen (559587cb) and adds tests for the re-add, the replay, the MVCC restore of a removal on unique and duplicate keys, and the BTree walk past the first page. The replay test is skipped on BTree: SoilBTreePage>>#cleanRemovedIn: removes a tombstone by key and can take the live duplicate next to it, which is a fault of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A page read back from disk holds its values as byte arrays, a page written in this image and a journal entry hold SoilObjectIds, and the two are never equal. Four places compared them with #= and failed after a reopen:
All of them, and SoilAddKeyEntry>>#isForItem:index:, now ask SoilIndexItemsPage class>>#value:matches:. Across representations the bytes decide; within one, #= does, because an object id without an index yet (a new object before commit) only matches itself - as bytes all of them would look the same and a second new value under a key would overwrite the first.
Carries the red test of duplicate-key-remove-after-reopen (559587cb) and adds tests for the re-add, the replay, the MVCC restore of a removal on unique and duplicate keys, and the BTree walk past the first page. The replay test is skipped on BTree: SoilBTreePage>>#cleanRemovedIn: removes a tombstone by key and can take the live duplicate next to it, which is a fault of its own.