-
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
storage, ccl: Use RocksDBv2 format for SSTs meant for ingestion #42763
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajkr, @dt, @itsbilal, @petermattis, and @sumeerbhola)
pkg/storage/engine/sst_writer.go, line 39 at r1 (raw file):
// is being written for ingestion, and when false, bloom filters are disabled // and the SST format is changed to LevelDB. func MakeSSTWriter(f writeCloseSyncer, ingestion bool) SSTWriter {
Passing a boolean ingestion
argument makes it difficult to read what is going on at the caller. You can improve the situation by adding an inline comment on that parameter, but in this case the parameter is (almost) always a constant and there is a better option: provide separate methods. Something like:
MakeBackupSSTWriter(...) {
}
MakeIngestionSSTWriter(...) {
}
d87dfa3
to
850034d
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! 0 of 0 LGTMs obtained (waiting on @ajkr, @dt, @petermattis, and @sumeerbhola)
pkg/storage/engine/sst_writer.go, line 39 at r1 (raw file):
Previously, petermattis (Peter Mattis) wrote…
Passing a boolean
ingestion
argument makes it difficult to read what is going on at the caller. You can improve the situation by adding an inline comment on that parameter, but in this case the parameter is (almost) always a constant and there is a better option: provide separate methods. Something like:MakeBackupSSTWriter(...) { } MakeIngestionSSTWriter(...) { }
That's more readable, yes. Thanks! Done.
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, @dt, @itsbilal, and @sumeerbhola)
pkg/storage/engine/sst_writer_test.go, line 112 at r2 (raw file):
kvs := makeIntTableKVs(numKeys, valueSize, revisions) sstRocks := makeRocksSST(t, kvs) sstPebble := makePebbleSST(t, kvs, false)
Nit: add an inline comment here: false /* ingestion */
.
pkg/storage/engine/sst_writer_test.go, line 174 at r2 (raw file):
b.StartTimer() for i := 0; i < ssts; i++ { _ = makePebbleSST(b, kvs, true)
Nit: add an inline comment here: true /* ingestion */
.
This change updates SSTWriter to use the RocksDBv2 format and to re-enable bloom filters on all SSTs written for ingestion (eg. snapshots). SSTs written for backup are still written in the leveldb format, and TestPebbleWritesSameSSTables still uses the leveldb format for comparison with those produced by RocksDBSstFileWriter. Fixes cockroachdb#41814. Release note: None.
850034d
to
6a7ec30
Compare
Thanks for the reviews! bors r+ |
Build failed |
TestCCLLogic flake. bors r+ |
Build failed |
Different unrelated compile time “no such file or directory” error. bors r+ |
Build failed |
Yet another unrelated failure, this time in bors r+ |
42763: storage, ccl: Use RocksDBv2 format for SSTs meant for ingestion r=itsbilal a=itsbilal This change updates SSTWriter to use the RocksDBv2 format and to re-enable bloom filters on all SSTs written for ingestion (eg. snapshots). SSTs written for backup are still written in the leveldb format, and TestPebbleWritesSameSSTables still uses the leveldb format for comparison with those produced by RocksDBSstFileWriter. Fixes #41814. Release note: None. Co-authored-by: Bilal Akhtar <[email protected]>
Build succeeded |
…ersion Change cockroachdb#42763 caused all SSTs written for ingestion to be written in the RocksDBv2 format as opposed to the leveldb format. This turned out to be an issue in mixed-version clusters where not all nodes can iterate over and ingest RocksDBv2 SSTs; nodes without commit 2beab58 (so 19.2.* and below) cannot iterate over these SSTs. This change reverts back to creating LevelDB SSTs for ingestion in the SSTBatcher only, unless the minimum cluster version is a 20.1 commit. Other cases where we make RocksDBv2 SSTs (eg. in replica_raftstorage) are okay and do not require this check, since those SSTs are ingested by the same node where they're written. Fixes cockroachdb#42081 . Release note: None.
43001: storage, ccl: Gate AddSSTable()ing RocksDBv2 format SSTs on cluster version r=itsbilal a=itsbilal Change #42763 caused all SSTs written for ingestion to be written in the RocksDBv2 format as opposed to the leveldb format. This turned out to be an issue in mixed-version clusters where not all nodes can iterate over and ingest RocksDBv2 SSTs; nodes without commit 2beab58 (so 19.2.* and below) cannot iterate over these SSTs. This change reverts back to creating LevelDB SSTs for ingestion in the SSTBatcher only, unless the minimum cluster version is a 20.1 commit. Other cases where we make RocksDBv2 SSTs (eg. in replica_raftstorage) are okay and do not require this check, since those SSTs are ingested by the same node where they're written. Fixes #42081 . Release note: None. Co-authored-by: Bilal Akhtar <[email protected]>
This change updates SSTWriter to use the RocksDBv2 format and to
re-enable bloom filters on all SSTs written for ingestion (eg.
snapshots). SSTs written for backup are still written in the
leveldb format, and TestPebbleWritesSameSSTables still uses
the leveldb format for comparison with those produced by
RocksDBSstFileWriter.
Fixes #41814.
Release note: None.