Skip to content

Commit

Permalink
Add a test for IO throttling for ALTER TABLE MOVE PARTITION TO VOLUME
Browse files Browse the repository at this point in the history
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
  • Loading branch information
azat committed Aug 29, 2023
1 parent 51e8b16 commit ed401cb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/config/config.d/storage_conf.xml
Expand Up @@ -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>
Expand Down
@@ -0,0 +1,3 @@
default tuple() 1000000
Alter 1
s3_disk tuple() 1000000
@@ -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;

0 comments on commit ed401cb

Please sign in to comment.