mpt: change to variable-width Key and Val types#80
Open
rsc wants to merge 2 commits into
Open
Conversation
Until now the client of pmem has not needed to know the size of the space used on the on-disk leaf file. Variable-sized keys and values is going to change that. Add tracking of the size of the disk data. Also be more explicit about the invariants guaranteed in transactions with respect to ReadDisk/WriteDisk, and test disks thoroughly in the random testing.
Allow variable-width Key and Val, so that applications are not locked into 32-byte blobs as the only possible format. Update disk format to support variable-width keys and values. The first write of a key reserves space for the number of bytes in the associated value. Future updates can overwrite that space as long as the value does not grow in size. If the value does get larger, then the existing space is abandoned (leaked) and new space is allocated. That strategy should be fine for now, since all of our applications have fixed-size values anyway. Also create and use new testdata/treehash.txt, test vectors for tree creation and snapshotting.
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.
Key and Val are now slices instead of fixed-width [32]byte values.
Client code will need updating, especially code that expects key1 := key2 to make a copy of the key.