Merge pull request #61396 from Algunenano/default_cluster

Remove default cluster from default config from test config
This commit is contained in:
robot-ch-test-poll4 2024-03-19 13:58:01 +01:00 committed by GitHub
commit a07d214fbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 79 additions and 32 deletions

View File

@ -1,5 +1,8 @@
<clickhouse>
<remote_servers>
<!-- Remove the default remote server to avoid people depending on its hardcoded config
Use test_shard_localhost instead -->
<default remove="remove"></default>
<test_shard_localhost>
<shard>
<replica>

View File

@ -29,4 +29,7 @@
</access_control_improvements>
<custom_cached_disks_base_directory replace="replace">/</custom_cached_disks_base_directory>
<!-- Remove the default remote server to avoid people depending on its hardcoded config -->
<remote_servers remove="remove"></remote_servers>
</clickhouse>

View File

@ -0,0 +1,12 @@
<clickhouse>
<remote_servers>
<default>
<shard>
<replica>
<host>node1</host>
<port>9000</port>
</replica>
</shard>
</default>
</remote_servers>
</clickhouse>

View File

@ -6,7 +6,10 @@ from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance(
"node",
main_configs=["configs/config.d/disable_access_control_improvements.xml"],
main_configs=[
"configs/config.d/disable_access_control_improvements.xml",
"configs/remote_servers.xml",
],
user_configs=[
"configs/users.d/another_user.xml",
],

View File

@ -0,0 +1,12 @@
<clickhouse>
<remote_servers>
<default>
<shard>
<replica>
<host>node1</host>
<port>9000</port>
</replica>
</shard>
</default>
</remote_servers>
</clickhouse>

View File

@ -9,6 +9,7 @@ from helpers.test_tools import assert_eq_with_retry, TSV
cluster = ClickHouseCluster(__file__)
instance = cluster.add_instance(
"instance",
main_configs=["configs/remote_servers.xml"],
user_configs=[
"configs/users.d/assign_myquota_to_default_user.xml",
"configs/users.d/drop_default_quota.xml",

View File

@ -0,0 +1,12 @@
<clickhouse>
<remote_servers>
<default>
<shard>
<replica>
<host>node1</host>
<port>9000</port>
</replica>
</shard>
</default>
</remote_servers>
</clickhouse>

View File

@ -6,6 +6,7 @@ from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance(
"node",
main_configs=["configs/remote_servers.xml"],
user_configs=[
"configs/another_user.xml",
],

View File

@ -1,7 +1,7 @@
-- { echoOn }
create table data (key Int) engine=Memory();
create table dist (key Int) engine=Distributed(default, currentDatabase(), data);
create table dist (key Int) engine=Distributed(test_shard_localhost, currentDatabase(), data);
system stop distributed sends dist;
-- check that FLUSH DISTRIBUTED does flushing anyway
insert into dist values (1);
@ -19,7 +19,7 @@ attach table dist;
truncate table data;
-- check flush_on_detach=0
drop table dist;
create table dist (key Int) engine=Distributed(default, currentDatabase(), data) settings flush_on_detach=0;
create table dist (key Int) engine=Distributed(test_shard_localhost, currentDatabase(), data) settings flush_on_detach=0;
system stop distributed sends dist;
insert into dist values (1);
detach table dist;

View File

@ -6,7 +6,7 @@ drop table if exists dist;
-- { echoOn }
create table data (key Int) engine=Memory();
create table dist (key Int) engine=Distributed(default, currentDatabase(), data);
create table dist (key Int) engine=Distributed(test_shard_localhost, currentDatabase(), data);
system stop distributed sends dist;
-- check that FLUSH DISTRIBUTED does flushing anyway
@ -25,7 +25,7 @@ truncate table data;
-- check flush_on_detach=0
drop table dist;
create table dist (key Int) engine=Distributed(default, currentDatabase(), data) settings flush_on_detach=0;
create table dist (key Int) engine=Distributed(test_shard_localhost, currentDatabase(), data) settings flush_on_detach=0;
system stop distributed sends dist;
insert into dist values (1);
detach table dist;

View File

@ -7,7 +7,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ arr │ Array(UInt64) │ DEFAULT │ [10, 20] │ │ ZSTD(1) │ │
│ t │ Tuple(a String, b UInt64) │ DEFAULT │ ('foo', 0) │ │ ZSTD(1) │ │
└──────┴───────────────────────────┴──────────────┴────────────────────┴──────────────┴──────────────────┴────────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name─┬─type──────────────────────┬─default_type─┬─default_expression─┬─comment──────┬─codec_expression─┬─ttl_expression─┐
│ id │ UInt64 │ │ │ index column │ │ │
│ arr │ Array(UInt64) │ DEFAULT │ [10, 20] │ │ ZSTD(1) │ │
@ -23,7 +23,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ t.a │ String │ │ │ │ ZSTD(1) │ │ 1 │
│ t.b │ UInt64 │ │ │ │ ZSTD(1) │ │ 1 │
└───────────┴───────────────────────────┴──────────────┴────────────────────┴──────────────┴──────────────────┴────────────────┴──────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name──────┬─type──────────────────────┬─default_type─┬─default_expression─┬─comment──────┬─codec_expression─┬─ttl_expression─┬─is_subcolumn─┐
│ id │ UInt64 │ │ │ index column │ │ │ 0 │
│ arr │ Array(UInt64) │ DEFAULT │ [10, 20] │ │ ZSTD(1) │ │ 0 │
@ -47,7 +47,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ _row_exists │ UInt8 │ │ │ Persisted mask created by lightweight delete that show whether row exists or is deleted │ │ │ 1 │
│ _block_number │ UInt64 │ │ │ Persisted original number of block that was assigned at insert │ Delta, LZ4 │ │ 1 │
└────────────────┴───────────────────────────┴──────────────┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴────────────────┴────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name───────────┬─type──────────────────────┬─default_type─┬─default_expression─┬─comment─────────────────────────────────────────────────────────────────────────────────┬─codec_expression─┬─ttl_expression─┬─is_virtual─┐
│ id │ UInt64 │ │ │ index column │ │ │ 0 │
│ arr │ Array(UInt64) │ DEFAULT │ [10, 20] │ │ ZSTD(1) │ │ 0 │
@ -80,7 +80,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ t.a │ String │ │ │ │ ZSTD(1) │ │ 1 │ 0 │
│ t.b │ UInt64 │ │ │ │ ZSTD(1) │ │ 1 │ 0 │
└────────────────┴───────────────────────────┴──────────────┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴────────────────┴──────────────┴────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name───────────┬─type──────────────────────┬─default_type─┬─default_expression─┬─comment─────────────────────────────────────────────────────────────────────────────────┬─codec_expression─┬─ttl_expression─┬─is_subcolumn─┬─is_virtual─┐
│ id │ UInt64 │ │ │ index column │ │ │ 0 │ 0 │
│ arr │ Array(UInt64) │ DEFAULT │ [10, 20] │ │ ZSTD(1) │ │ 0 │ 0 │
@ -105,7 +105,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ arr │ Array(UInt64) │
│ t │ Tuple(a String, b UInt64) │
└──────┴───────────────────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name─┬─type──────────────────────┐
│ id │ UInt64 │
│ arr │ Array(UInt64) │
@ -121,7 +121,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ t.a │ String │ 1 │
│ t.b │ UInt64 │ 1 │
└───────────┴───────────────────────────┴──────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name──────┬─type──────────────────────┬─is_subcolumn─┐
│ id │ UInt64 │ 0 │
│ arr │ Array(UInt64) │ 0 │
@ -145,7 +145,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ _row_exists │ UInt8 │ 1 │
│ _block_number │ UInt64 │ 1 │
└────────────────┴───────────────────────────┴────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name───────────┬─type──────────────────────┬─is_virtual─┐
│ id │ UInt64 │ 0 │
│ arr │ Array(UInt64) │ 0 │
@ -178,7 +178,7 @@ DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
│ t.a │ String │ 1 │ 0 │
│ t.b │ UInt64 │ 1 │ 0 │
└────────────────┴───────────────────────────┴──────────────┴────────────┘
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
┌─name───────────┬─type──────────────────────┬─is_subcolumn─┬─is_virtual─┐
│ id │ UInt64 │ 0 │ 0 │
│ arr │ Array(UInt64) │ 0 │ 0 │

View File

@ -14,42 +14,42 @@ ORDER BY id;
SET describe_compact_output = 0, describe_include_virtual_columns = 0, describe_include_subcolumns = 0;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 0, describe_include_virtual_columns = 0, describe_include_subcolumns = 1;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 0, describe_include_virtual_columns = 1, describe_include_subcolumns = 0;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 0, describe_include_virtual_columns = 1, describe_include_subcolumns = 1;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 1, describe_include_virtual_columns = 0, describe_include_subcolumns = 0;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 1, describe_include_virtual_columns = 0, describe_include_subcolumns = 1;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 1, describe_include_virtual_columns = 1, describe_include_subcolumns = 0;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
SET describe_compact_output = 1, describe_include_virtual_columns = 1, describe_include_subcolumns = 1;
DESCRIBE TABLE t_describe_options FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(default, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
DESCRIBE remote(test_shard_localhost, currentDatabase(), t_describe_options) FORMAT PrettyCompactNoEscapes;
-- { echoOff }

View File

@ -10,7 +10,7 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# (i.e. "No active replica has part X or covering part")
# does not appears as errors (level=Error), only as info message (level=Information).
cluster=default
cluster=test_shard_localhost
if [[ $($CLICKHOUSE_CLIENT -q "select count()>0 from system.clusters where cluster = 'test_cluster_database_replicated'") = 1 ]]; then
cluster=test_cluster_database_replicated
fi

View File

@ -1,8 +1,8 @@
CREATE TABLE default.dist_monitor_batch_inserts\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS monitor_batch_inserts = 1
CREATE TABLE default.dist_monitor_split_batch_on_failure\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS monitor_split_batch_on_failure = 1
CREATE TABLE default.dist_monitor_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS monitor_sleep_time_ms = 1
CREATE TABLE default.dist_monitor_max_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS monitor_max_sleep_time_ms = 1
CREATE TABLE default.dist_background_insert_batch\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS background_insert_batch = 1
CREATE TABLE default.dist_background_insert_split_batch_on_failure\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS background_insert_split_batch_on_failure = 1
CREATE TABLE default.dist_background_insert_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS background_insert_sleep_time_ms = 1
CREATE TABLE default.dist_background_insert_max_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'default\', \'system\', \'one\')\nSETTINGS background_insert_max_sleep_time_ms = 1
CREATE TABLE default.dist_monitor_batch_inserts\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS monitor_batch_inserts = 1
CREATE TABLE default.dist_monitor_split_batch_on_failure\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS monitor_split_batch_on_failure = 1
CREATE TABLE default.dist_monitor_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS monitor_sleep_time_ms = 1
CREATE TABLE default.dist_monitor_max_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS monitor_max_sleep_time_ms = 1
CREATE TABLE default.dist_background_insert_batch\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS background_insert_batch = 1
CREATE TABLE default.dist_background_insert_split_batch_on_failure\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS background_insert_split_batch_on_failure = 1
CREATE TABLE default.dist_background_insert_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS background_insert_sleep_time_ms = 1
CREATE TABLE default.dist_background_insert_max_sleep_time_ms\n(\n `dummy` UInt8\n)\nENGINE = Distributed(\'test_shard_localhost\', \'system\', \'one\')\nSETTINGS background_insert_max_sleep_time_ms = 1

View File

@ -10,13 +10,13 @@
'background_insert_max_sleep_time_ms',
] %}
drop table if exists dist_{{ table_setting }};
create table dist_{{ table_setting }} as system.one engine=Distributed(default, system, one) settings {{ table_setting }}=1;
create table dist_{{ table_setting }} as system.one engine=Distributed(test_shard_localhost, system, one) settings {{ table_setting }}=1;
show create dist_{{ table_setting }};
drop table dist_{{ table_setting }};
{% endfor %}
create table data (key Int) engine=Null();
create table dist (key Int) engine=Distributed(default, currentDatabase(), data, key);
create table dist (key Int) engine=Distributed(test_shard_localhost, currentDatabase(), data, key);
{% for query_setting in [
'distributed_directory_monitor_sleep_time_ms',
'distributed_directory_monitor_max_sleep_time_ms',