-
Notifications
You must be signed in to change notification settings - Fork 472
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
db: add UserKeyCategories #4210
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @itsbilal and @RaduBerinde)
options.go
line 2209 at r1 (raw file):
// UserKeyCategories describes a partitioning of the user key space. Each // partition is a category with a name, which is used for informative purposes // (like pprof labels).
maybe add something explicitly emphasizing that these partitions are not physically materialized
options.go
line 2243 at r1 (raw file):
} if categories[n-1].UpperBound != nil { panic("last category UperBound must be nil")
nit: UpperBound
Add a way to configure Pebble with an informative partitioning of the key space. Each partition is a named key category; we use these for pprof labels. We currently set these pprof labels for compactions. In the future, we will allow turning on labels in the read/write paths for specific investigations. Sample CRDB configuration code: ``` var userKeyCategories = pebble.MakeUserKeyCategories( EngineComparer.Compare, []pebble.UserKeyCategory{ {Name: "local-1", UpperBound: toEngineKey(keys.LocalRangeIDPrefix.AsRawKey())}, {Name: "rangeid", UpperBound: toEngineKey(keys.LocalRangeIDPrefix.AsRawKey().PrefixEnd())}, {Name: "local-2", UpperBound: toEngineKey(keys.LocalRangePrefix)}, {Name: "range", UpperBound: toEngineKey(keys.LocalRangePrefix.PrefixEnd())}, {Name: "local-3", UpperBound: toEngineKey(keys.LocalRangeLockTablePrefix)}, {Name: "lock", UpperBound: toEngineKey(keys.LocalRangeLockTablePrefix.PrefixEnd())}, {Name: "local-4", UpperBound: toEngineKey(keys.LocalPrefix.PrefixEnd())}, {Name: "meta", UpperBound: toEngineKey(keys.MetaMax)}, {Name: "system", UpperBound: toEngineKey(keys.SystemMax)}, {Name: "tenant"}, }..., ) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @itsbilal and @jbowens)
options.go
line 2209 at r1 (raw file):
Previously, jbowens (Jackson Owens) wrote…
maybe add something explicitly emphasizing that these partitions are not physically materialized
Done.
Add a way to configure Pebble with an informative partitioning of the
key space. Each partition is a named key category; we use these for
pprof labels.
We currently set these pprof labels for compactions. In the future, we
will allow turning on labels in the read/write paths for specific
investigations.
Sample CRDB configuration code: