Merge pull request #29393 from azat/rocksdb-fix-data-race

rocksdb: fix race condition during multiple DB opening
This commit is contained in:
Maksim Kita 2021-09-27 11:32:59 +03:00 committed by GitHub
commit f7aed5aab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

2
contrib/rocksdb vendored

@ -1 +1 @@
Subproject commit 5ea892c8673e6c5a052887653673b967d44cc59b
Subproject commit 296c1b8b95fd448b8097a1b2cc9f704ff4a73a2c

View File

@ -58,8 +58,28 @@ def test_valid_column_family_options(start_cluster):
DROP TABLE test;
""")
def test_invalid_column_family_options(start_cluster):
node.exec_in_container(['bash', '-c', "sed -i 's/num_levels/no_such_column_family_option/g' /etc/clickhouse-server/config.d/rocksdb.xml"])
node.restart_clickhouse()
with pytest.raises(QueryRuntimeException):
node.query("""
CREATE TABLE test (key UInt64, value String) Engine=EmbeddedRocksDB PRIMARY KEY(key);
""")
node.exec_in_container(['bash', '-c', "sed -i 's/no_such_column_family_option/num_levels/g' /etc/clickhouse-server/config.d/rocksdb.xml"])
node.restart_clickhouse()
def test_table_valid_column_family_options(start_cluster):
node.query("""
CREATE TABLE test (key UInt64, value String) Engine=EmbeddedRocksDB PRIMARY KEY(key);
DROP TABLE test;
""")
def test_table_invalid_column_family_options(start_cluster):
node.exec_in_container(['bash', '-c', "sed -i 's/max_bytes_for_level_base/no_such_table_column_family_option/g' /etc/clickhouse-server/config.d/rocksdb.xml"])
node.restart_clickhouse()
with pytest.raises(QueryRuntimeException):
node.query("""
CREATE TABLE test (key UInt64, value String) Engine=EmbeddedRocksDB PRIMARY KEY(key);
""")
node.exec_in_container(['bash', '-c', "sed -i 's/no_such_table_column_family_option/max_bytes_for_level_base/g' /etc/clickhouse-server/config.d/rocksdb.xml"])
node.restart_clickhouse()