mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix test 01114_database_atomic (more rows to fit to execution time expected in test).
This commit is contained in:
parent
bc63042723
commit
1fc82fbeec
@ -4,14 +4,14 @@ CREATE DATABASE test_01114_3\nENGINE = Ordinary
|
||||
test_01114_1 Atomic store 00001114-1000-4000-8000-000000000001 1
|
||||
test_01114_2 Atomic store 00001114-1000-4000-8000-000000000002 1
|
||||
test_01114_3 Ordinary test_01114_3 test_01114_3 1
|
||||
20
|
||||
110
|
||||
100
|
||||
CREATE TABLE test_01114_2.mt UUID \'00001114-0000-4000-8000-000000000002\'\n(\n `n` UInt64\n)\nENGINE = MergeTree\nPARTITION BY n % 5\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
mt 00001114-0000-4000-8000-000000000002 CREATE TABLE test_01114_2.mt (`n` UInt64) ENGINE = MergeTree PARTITION BY n % 5 ORDER BY tuple() SETTINGS index_granularity = 8192
|
||||
20
|
||||
110
|
||||
CREATE TABLE test_01114_1.mt UUID \'00001114-0000-4000-8000-000000000001\'\n(\n `n` UInt64\n)\nENGINE = MergeTree\nPARTITION BY n % 5\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
CREATE TABLE test_01114_2.mt UUID \'00001114-0000-4000-8000-000000000002\'\n(\n `n` UInt64\n)\nENGINE = MergeTree\nPARTITION BY n % 5\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
5
|
||||
dropped
|
||||
20 190
|
||||
110 5995
|
||||
30 435
|
||||
|
@ -33,7 +33,7 @@ $CLICKHOUSE_CLIENT -nm -q "
|
||||
CREATE TABLE test_01114_1.mt_tmp (n UInt64) ENGINE=MergeTree() ORDER BY tuple();
|
||||
INSERT INTO test_01114_1.mt_tmp SELECT * FROM numbers(100);
|
||||
CREATE TABLE test_01114_3.mt (n UInt64) ENGINE=MergeTree() ORDER BY tuple() PARTITION BY (n % 5);
|
||||
INSERT INTO test_01114_3.mt SELECT * FROM numbers(20);
|
||||
INSERT INTO test_01114_3.mt SELECT * FROM numbers(110);
|
||||
|
||||
RENAME TABLE test_01114_1.mt_tmp TO test_01114_3.mt_tmp; /* move from Atomic to Ordinary */
|
||||
RENAME TABLE test_01114_3.mt TO test_01114_1.mt; /* move from Ordinary to Atomic */
|
||||
@ -49,8 +49,8 @@ $CLICKHOUSE_CLIENT --show_table_uuid_in_table_create_query_if_not_nil=1 -q "SHOW
|
||||
$CLICKHOUSE_CLIENT -q "SELECT name, uuid, create_table_query FROM system.tables WHERE database='test_01114_2'" | sed "s/$explicit_uuid/00001114-0000-4000-8000-000000000002/g"
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count(col), sum(col) FROM (SELECT n + sleepEachRow(1.5) AS col FROM test_01114_1.mt)" & # 30s, result: 20, 190
|
||||
$CLICKHOUSE_CLIENT -q "INSERT INTO test_01114_2.mt SELECT number + sleepEachRow(1.5) FROM numbers(30)" & # 45s
|
||||
$CLICKHOUSE_CLIENT -q "SELECT count(col), sum(col) FROM (SELECT n + sleepEachRow(1.5) AS col FROM test_01114_1.mt)" & # 33s (1.5s * 22 rows per partition), result: 110, 5995
|
||||
$CLICKHOUSE_CLIENT -q "INSERT INTO test_01114_2.mt SELECT number + sleepEachRow(1.5) FROM numbers(30)" & # 45s (1.5s * 30 rows)
|
||||
sleep 1 # SELECT and INSERT should start before the following RENAMEs
|
||||
|
||||
$CLICKHOUSE_CLIENT -nm -q "
|
||||
@ -74,7 +74,7 @@ INSERT INTO test_01114_1.mt SELECT 's' || toString(number) FROM numbers(5);
|
||||
SELECT count() FROM test_01114_1.mt
|
||||
" # result: 5
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "SELECT tuple(s, sleepEachRow(3)) FROM test_01114_1.mt" > /dev/null & # 15s
|
||||
$CLICKHOUSE_CLIENT -q "SELECT tuple(s, sleepEachRow(3)) FROM test_01114_1.mt" > /dev/null & # 15s (3s * 5 rows)
|
||||
sleep 1
|
||||
$CLICKHOUSE_CLIENT -q "DROP DATABASE test_01114_1" --database_atomic_wait_for_drop_and_detach_synchronously=0 && echo "dropped"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user