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

sstable: add range keys to sstable.Layout #1410

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

nicktrav
Copy link
Contributor

The sstable.Layout struct contains information pertaining to the
layout of an sstable. Add the range key block to the layout.

Related to #1339.

The `sstable.Layout` struct contains information pertaining to the
layout of an sstable. Add the range key block to the layout.

Related to cockroachdb#1339.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -133,9 +133,9 @@ type Properties struct {
// Total raw key size.
RawKeySize uint64 `prop:"rocksdb.raw.key.size"`
// Total raw rangekey key size.
RawRangeKeyKeySize uint64 `prop:"pebble.raw.rangekey.key.size"`
RawRangeKeyKeySize uint64 `prop:"pebble.raw.range-key.key.size"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two changes are purely cosmetic, and make the range key property names consistent (i.e. hyphenated).

@nicktrav nicktrav mentioned this pull request Dec 14, 2021
29 tasks
Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

:LGTM:

Seeing this PR reminded me of one more range-key block change that we should consider doing: the *sstable.Reader type has an EstimateDiskUsage method. If the sstable has range keys, I think we should check if the range key block contains any range keys that overlap with the key span passed to EstimateDiskUsage. If there are, we should add the entire length of the range-key block to the estimate returned.

Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @sumeerbhola)

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 3 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jbowens and @sumeerbhola)

Copy link
Contributor Author

@nicktrav nicktrav left a comment

Choose a reason for hiding this comment

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

If there are, we should add the entire length of the range-key block to the estimate returned.

Ack. Will ensure we're tracking this task.

TFTRs!

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @nicktrav)

@nicktrav nicktrav merged commit bcd4c82 into cockroachdb:master Dec 16, 2021
@nicktrav nicktrav deleted the nickt.rangekeys-layout branch December 16, 2021 17:35
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.

4 participants