-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli: Add flag to choose pebble as storage engine #41453
Conversation
Dependency graph of related PRs:
|
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajkr, @itsbilal, @petermattis, and @sumeerbhola)
pkg/base/config.go, line 153 at r2 (raw file):
// Type implements the pflag.Value interface. func (e *EngineType) Type() string { return "string" }
I'm not sure what Type()
is used for, but I think it is supposed to distinguish from other flag types. Perhaps this should be "engine"
.
pkg/server/config.go, line 496 at r2 (raw file):
// TODO(itsbilal): Tune these options, and allow them to be overridden // in the spec (similar to the existing spec.RocksDBOptions and others). pebbleOpts := &pebble.Options{
You don't seem to be specifying cache
. Am I missing where that is done?
Not reviewing the code yet, I have two questions and a remark:
|
A per-store flag is possible, but then we need to figure out how to allocate the block cache between Pebble and RocksDB. My preference is to avoid this complication and just make the flag apply to all stores. Actually trying to share the block cache between Pebble and RocksDB is a non-starter due to technical difficulty.
Oh, good point. We should make this apply to temporary stores too! |
This is a good explanation. It should be detailed in the commit message too. |
Peter has already answered this, but yes, the goal is to eliminate double-caching. I had originally implemented a per-store flag but was advised to go with this approach. There's a separate flag for temp stores that's already in master and 19.2, There's probably more value in having more fine-grained control of each store that way, right? Instead of having |
I had forgotten about |
9feb314
to
63d5297
Compare
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.
Updated commit message, added a release note, fixed cache instantiation (discussed in #41199), and removed --temp-storage
. PTAL!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajkr, @petermattis, and @sumeerbhola)
pkg/base/config.go, line 153 at r2 (raw file):
Previously, petermattis (Peter Mattis) wrote…
I'm not sure what
Type()
is used for, but I think it is supposed to distinguish from other flag types. Perhaps this should be"engine"
.
It seems like we expect it to be a primitive type everywhere else. Other similar Type()
functions on CLI argument types seem to return either string
or int
or something of that nature.
pkg/server/config.go, line 496 at r2 (raw file):
Previously, petermattis (Peter Mattis) wrote…
You don't seem to be specifying
cache
. Am I missing where that is done?
Done. Cache is instantiated here now.
💯 |
63d5297
to
ce649d3
Compare
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ajkr, @itsbilal, and @sumeerbhola)
pkg/base/config.go, line 153 at r2 (raw file):
Previously, itsbilal (Bilal Akhtar) wrote…
It seems like we expect it to be a primitive type everywhere else. Other similar
Type()
functions on CLI argument types seem to return eitherstring
orint
or something of that nature.
It doesn't have to be a primitive type. The spf13/pflag
library we use internally uses types like intSlice
and stringArray
. I'm not quite sure what the purpose of this is, though. The docs provide no clue and it only seems to be used for special formatting. Fine to leave as "string".
This change adds a --storage-engine CLI flag, which has options `rocksdb` and `pebble`. Specifying `pebble` ensures all stores created on this node, including the temp engine, use pebble instead of rocksdb. This is a per-node flag instead of a per-store flag to eliminate cases where we have to maintain two caches, one for rocksdb instances and one for pebble instances. Also remove --temp-engine flag, which is now unnecessary. Release note (cli change): Add command-line argument --storage-engine to specify type of storage engine to use. Options are rocksdb (default) and pebble.
ce649d3
to
cb77d2b
Compare
Thanks for the review! Did a no-change rebase, going to merge when CI is green. Though the flag will practically be useless until #41452 lands. |
You might want to hold off on merging, or perhaps add a commit which disables support for pebble, otherwise you'll be fielding questions about why pebble doesn't work. |
Makes sense. I'll hold off on merging until #41452 lands then. Thanks! |
bors r+ |
41452: engine: Port MVCCScanner to Go, implement MVCCScan for pebble r=itsbilal a=itsbilal This change ports the MVCC Scanner from libroach to go, for use with Pebble's iterators. One half of the work involved in #39674. Also updates pebbleIterator to call it in pebbleIterator.MVCC*. First commit is #41199 , which should merge soon. Release note: None 41453: cli: Add flag to choose pebble as storage engine r=itsbilal a=itsbilal This change adds a --storage-engine CLI flag, which has options `rocksdb` and `pebble`. Specifying `pebble` ensures all stores created on this node, including the temp engine, use pebble instead of rocksdb. This is a per-node flag instead of a per-store flag to eliminate cases where we have to maintain two caches, one for rocksdb instances and one for pebble instances. Also remove --temp-engine flag, which is now unnecessary. Release note (cli change): Add command-line argument --storage-engine to specify type of storage engine to use. Options are rocksdb (default) and pebble. Co-authored-by: Bilal Akhtar <[email protected]>
Build succeeded |
This change adds a --storage-engine CLI flag, which has options
rocksdb
andpebble
. Specifyingpebble
ensures all stores createdon this node, including the temp engine, use pebble instead of rocksdb.
This is a per-node flag instead of a per-store flag to eliminate cases
where we have to maintain two caches, one for rocksdb instances and
one for pebble instances.
Also remove --temp-engine flag, which is now unnecessary.
Release note (cli change): Add command-line argument --storage-engine
to specify type of storage engine to use. Options are rocksdb (default)
and pebble.