Merge pull request #6850 from ClickHouse/enable_use_minimalistic_part_header_in_zookeeper

Enable "use_minimalistic_part_header_in_zookeeper" by default
This commit is contained in:
alexey-milovidov 2019-12-29 19:42:27 +03:00 committed by GitHub
commit 55a72a5485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 46 deletions

View File

@ -78,7 +78,7 @@ struct MergeTreeSettings : public SettingsCollection<MergeTreeSettings>
/** Compatibility settings */ \
M(SettingBool, compatibility_allow_sampling_expression_not_in_primary_key, false, "Allow to create a table with sampling expression not in primary key. This is needed only to temporarily allow to run the server with wrong tables for backward compatibility.", 0) \
M(SettingBool, use_minimalistic_checksums_in_zookeeper, true, "Use small format (dozens bytes) for part checksums in ZooKeeper instead of ordinary ones (dozens KB). Before enabling check that all replicas support new format.", 0) \
M(SettingBool, use_minimalistic_part_header_in_zookeeper, false, "Store part header (checksums and columns) in a compact format and a single part znode instead of separate znodes (<part>/columns and <part>/checksums). This can dramatically reduce snapshot size in ZooKeeper. Before enabling check that all replicas support new format.", 0) \
M(SettingBool, use_minimalistic_part_header_in_zookeeper, true, "Store part header (checksums and columns) in a compact format and a single part znode instead of separate znodes (<part>/columns and <part>/checksums). This can dramatically reduce snapshot size in ZooKeeper. Before enabling check that all replicas support new format.", 0) \
M(SettingUInt64, finished_mutations_to_keep, 100, "How many records about mutations that are done to keep. If zero, then keep all of them.", 0) \
M(SettingUInt64, min_merge_bytes_to_use_direct_io, 10ULL * 1024 * 1024 * 1024, "Minimal amount of bytes to enable O_DIRECT in merge (0 - disabled).", 0) \
M(SettingUInt64, index_granularity_bytes, 10 * 1024 * 1024, "Approximate amount of bytes in single granule (0 - disabled).", 0) \

View File

@ -1,13 +1,5 @@
columns format version: 1
1 columns:
`d` Date
2014-01-01
2014-01-01 0
2014-02-01 1
2014-01-01
2014-02-01
columns format version: 1
1 columns:
`d` Date

View File

@ -4,8 +4,6 @@ CREATE TABLE alter_00121 (d Date, x UInt8) ENGINE = ReplicatedMergeTree('/clickh
INSERT INTO alter_00121 VALUES ('2014-01-01', 1);
ALTER TABLE alter_00121 DROP COLUMN x;
SELECT value FROM system.zookeeper WHERE path = '/clickhouse/tables/test/alter_00121/replicas/r1/parts/20140101_20140101_0_0_0' AND name = 'columns' FORMAT TabSeparatedRaw;
DROP TABLE alter_00121;
@ -22,6 +20,4 @@ SELECT * FROM alter_00121 ORDER BY d;
ALTER TABLE alter_00121 DROP COLUMN x;
SELECT * FROM alter_00121 ORDER BY d;
SELECT value FROM system.zookeeper WHERE path = '/clickhouse/tables/test/alter_00121/replicas/r1/parts/20140201_20140201_0_0_0' AND name = 'columns' FORMAT TabSeparatedRaw;
DROP TABLE alter_00121;

View File

@ -1,9 +0,0 @@
1
1
0 []
1 []
0 []
1 []
DETACH
0 []
1 []

View File

@ -1,24 +0,0 @@
DROP TABLE IF EXISTS table_old;
DROP TABLE IF EXISTS table_new;
CREATE TABLE table_old (k UInt64, d Array(String)) ENGINE = ReplicatedMergeTree('/clickhouse/test/tables/checksums_test', 'old') ORDER BY k SETTINGS use_minimalistic_checksums_in_zookeeper=0;
CREATE TABLE table_new (k UInt64, d Array(String)) ENGINE = ReplicatedMergeTree('/clickhouse/test/tables/checksums_test', 'new') ORDER BY k SETTINGS use_minimalistic_checksums_in_zookeeper=1;
SET insert_quorum=2;
INSERT INTO table_old VALUES (0, []);
SELECT value LIKE '%checksums format version: 4%' FROM system.zookeeper WHERE path='/clickhouse/test/tables/checksums_test/replicas/old/parts/all_0_0_0' AND name = 'checksums';
INSERT INTO table_new VALUES (1, []);
SELECT value LIKE '%checksums format version: 5%' FROM system.zookeeper WHERE path='/clickhouse/test/tables/checksums_test/replicas/new/parts/all_1_1_0' AND name = 'checksums';
OPTIMIZE TABLE table_old;
SELECT * FROM table_old ORDER BY k;
SELECT * FROM table_new ORDER BY k;
SELECT 'DETACH';
DETACH TABLE table_old;
ATTACH TABLE table_old (k UInt64, d Array(String)) ENGINE = ReplicatedMergeTree('/clickhouse/test/tables/checksums_test', 'old') ORDER BY k SETTINGS use_minimalistic_checksums_in_zookeeper=1;
SELECT * FROM table_old ORDER BY k;
DROP TABLE IF EXISTS table_old;
DROP TABLE IF EXISTS table_new;