Add a test for IO throttling for ALTER TABLE MOVE PARTITION TO VOLUME

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2023-08-29 23:11:35 +02:00
parent 51e8b16916
commit ed401cba9b
3 changed files with 20 additions and 0 deletions

View File

@ -72,6 +72,12 @@
</s3_cache_multi_2>
</disks>
<policies>
<local_remote>
<volumes>
<local><disk>default</disk></local>
<remote><disk>s3_disk</disk></remote>
</volumes>
</local_remote>
<s3_cache>
<volumes>
<main>

View File

@ -0,0 +1,3 @@
default tuple() 1000000
Alter 1
s3_disk tuple() 1000000

View File

@ -0,0 +1,11 @@
-- Tags: no-random-merge-tree-settings, no-fasttest
-- Tag: no-fasttest -- requires S3
CREATE TABLE test_move_partition_throttling (key UInt64 CODEC(NONE)) ENGINE = MergeTree ORDER BY tuple() SETTINGS storage_policy='local_remote';
INSERT INTO test_move_partition_throttling SELECT number FROM numbers(1e6);
SELECT disk_name, partition, rows FROM system.parts WHERE database = currentDatabase() AND table = 'test_move_partition_throttling' and active;
ALTER TABLE test_move_partition_throttling MOVE PARTITION tuple() TO VOLUME 'remote' SETTINGS max_remote_write_network_bandwidth=1600000;
SYSTEM FLUSH LOGS;
-- (8e6-1600000)/1600000=4.0
SELECT query_kind, query_duration_ms>4e3 FROM system.query_log WHERE type = 'QueryFinish' AND current_database = currentDatabase() AND query_kind = 'Alter';
SELECT disk_name, partition, rows FROM system.parts WHERE database = currentDatabase() AND table = 'test_move_partition_throttling' and active;