sstable: add range keys to sstable.Layout#1410
Conversation
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.
| 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"` |
There was a problem hiding this comment.
These two changes are purely cosmetic, and make the range key property names consistent (i.e. hyphenated).
jbowens
left a comment
There was a problem hiding this comment.
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)
sumeerbhola
left a comment
There was a problem hiding this comment.
Reviewed 2 of 3 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jbowens and @sumeerbhola)
nicktrav
left a comment
There was a problem hiding this comment.
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:
complete! all files reviewed, all discussions resolved (waiting on @nicktrav)
The
sstable.Layoutstruct contains information pertaining to thelayout of an sstable. Add the range key block to the layout.
Related to #1339.