Skip to content

sstable: add range keys to sstable.Layout#1410

Merged
nicktrav merged 1 commit intocockroachdb:masterfrom
nicktrav:nickt.rangekeys-layout
Dec 16, 2021
Merged

sstable: add range keys to sstable.Layout#1410
nicktrav merged 1 commit intocockroachdb:masterfrom
nicktrav:nickt.rangekeys-layout

Conversation

@nicktrav
Copy link
Copy Markdown
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
Copy Markdown
Member

This change is Reviewable

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
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
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