Skip to content
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

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

itsbilal
Copy link
Contributor

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.

@itsbilal itsbilal self-assigned this Nov 25, 2019
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: 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(...) {
}

@itsbilal itsbilal force-pushed the sstwriter-format-change branch from d87dfa3 to 850034d Compare November 26, 2019 16:06
Copy link
Contributor Author

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: 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.

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: 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.
@itsbilal itsbilal force-pushed the sstwriter-format-change branch from 850034d to 6a7ec30 Compare November 26, 2019 17:29
@itsbilal
Copy link
Contributor Author

Thanks for the reviews!

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 26, 2019

Build failed

@itsbilal
Copy link
Contributor Author

TestCCLLogic flake.

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 26, 2019

Build failed

@itsbilal
Copy link
Contributor Author

Different unrelated compile time “no such file or directory” error.

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 26, 2019

Build failed

@itsbilal
Copy link
Contributor Author

Yet another unrelated failure, this time in TestChangefeedTelemetry. My luck is hilariously bad today. The union of the above test runs is still a pass.

bors r+

craig bot pushed a commit that referenced this pull request Nov 26, 2019
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]>
@craig
Copy link
Contributor

craig bot commented Nov 26, 2019

Build succeeded

itsbilal added a commit to itsbilal/cockroach that referenced this pull request Dec 6, 2019
…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.
craig bot pushed a commit that referenced this pull request Dec 6, 2019
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]>
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.

storage, bulk: Use RocksDB format for SSTs meant for ingestion
4 participants