Skip to content
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

fix bug with new sstable index format #1953

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

trinity-1686a
Copy link
Contributor

in #1943 , I introduced a small bug where the index-sstable wouldn't honor block size, and make a single block that's as large as needed. Fixing that uncovered a different issue: contrary to what the spec says, we did not actually support a multiblock index-sstable, for all but the 1st block, the BlockAddr::byte_range would be plain wrong.

Discovered while trying to assess the theoretical effect implementing something like #1948 could have

```

- EntryCount(VInt): number of entries
- StartPos(VInt): the start pos of the first (data) block referenced by this (index) block
Copy link
Collaborator

@fulmicoton fulmicoton Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pos is ambiguous. does that mean byte offset? is it not 0?

@@ -151,6 +151,7 @@ impl SSTableIndexBuilder {

sstable_writer.write_suffix(keep_len, &block.last_key_or_greater[keep_len..]);
sstable_writer.write_value(&block.block_addr);
sstable_writer.flush_block_if_required()?;
Copy link
Collaborator

@fulmicoton fulmicoton Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we handle having more than one block in the sstable_index itself? I thought is was a single monoblock we deserialized entirely to run binary search

@trinity-1686a trinity-1686a merged commit 482b415 into main Mar 22, 2023
@trinity-1686a trinity-1686a deleted the trinity--new-sstable-format-fixup branch March 22, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants