mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #24560 from ClickHouse/more-diagnostic-for-test_jbod_overflow
Update test_multiple_disks
This commit is contained in:
commit
00628925eb
@ -335,9 +335,9 @@ def get_random_string(length):
|
|||||||
|
|
||||||
|
|
||||||
def get_used_disks_for_table(node, table_name):
|
def get_used_disks_for_table(node, table_name):
|
||||||
return node.query(
|
return tuple(node.query(
|
||||||
"select disk_name from system.parts where table == '{}' and active=1 order by modification_time".format(
|
"select disk_name from system.parts where table == '{}' and active=1 order by modification_time".format(
|
||||||
table_name)).strip().split('\n')
|
table_name)).strip().split('\n'))
|
||||||
|
|
||||||
|
|
||||||
def get_used_parts_for_table(node, table_name):
|
def get_used_parts_for_table(node, table_name):
|
||||||
@ -450,7 +450,7 @@ def test_jbod_overflow(start_cluster, name, engine):
|
|||||||
node1.query("INSERT INTO {} VALUES {}".format(name, ','.join(["('" + x + "')" for x in data])))
|
node1.query("INSERT INTO {} VALUES {}".format(name, ','.join(["('" + x + "')" for x in data])))
|
||||||
|
|
||||||
used_disks = get_used_disks_for_table(node1, name)
|
used_disks = get_used_disks_for_table(node1, name)
|
||||||
assert all(disk == 'jbod1' for disk in used_disks)
|
assert used_disks == tuple('jbod1' for _ in used_disks)
|
||||||
|
|
||||||
# should go to the external disk (jbod is overflown)
|
# should go to the external disk (jbod is overflown)
|
||||||
data = [] # 10MB in total
|
data = [] # 10MB in total
|
||||||
@ -469,11 +469,11 @@ def test_jbod_overflow(start_cluster, name, engine):
|
|||||||
node1.query("OPTIMIZE TABLE {} FINAL".format(name))
|
node1.query("OPTIMIZE TABLE {} FINAL".format(name))
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
disks_for_merges = node1.query(
|
disks_for_merges = tuple(node1.query(
|
||||||
"SELECT disk_name FROM system.parts WHERE table == '{}' AND level >= 1 and active = 1 ORDER BY modification_time".format(
|
"SELECT disk_name FROM system.parts WHERE table == '{}' AND level >= 1 and active = 1 ORDER BY modification_time".format(
|
||||||
name)).strip().split('\n')
|
name)).strip().split('\n'))
|
||||||
|
|
||||||
assert all(disk == 'external' for disk in disks_for_merges)
|
assert disks_for_merges == tuple('external' for _ in disks_for_merges)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
node1.query(f"DROP TABLE IF EXISTS {name} SYNC")
|
node1.query(f"DROP TABLE IF EXISTS {name} SYNC")
|
||||||
|
Loading…
Reference in New Issue
Block a user