This commit is contained in:
Sema Checherinda 2024-08-02 18:23:56 +02:00
parent a3b73e94aa
commit 462fe8b7ff
2 changed files with 87 additions and 0 deletions

View File

@ -1,4 +1,12 @@
<clickhouse>
<blob_storage_log>
<database>system</database>
<table>blob_storage_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<ttl>event_date + INTERVAL 30 DAY</ttl>
</blob_storage_log>
<storage_configuration>
<disks>
<disk1>

View File

@ -38,3 +38,82 @@ def test_storage_policy_configuration_change(started_cluster):
"/etc/clickhouse-server/config.d/disks.xml",
)
node.start_clickhouse()
def test_disk_is_immutable(started_cluster):
node.query("DROP TABLE IF EXISTS test_1")
node.query(
"""
create table test_1 (a Int32)
engine = MergeTree()
order by tuple()
settings
disk=disk(
name='not_uniq_disk_name',
type = object_storage,
object_storage_type = local_blob_storage,
path='./03215_data_test_1/')
"""
)
node.query("INSERT INTO test_1 VALUES (1)")
node.query("SYSTEM FLUSH LOGS;")
print(
node.query(
"SELECT 'test_1', * FROM system.blob_storage_log"
)
)
print(
node.query(
"SELECT 'test_1', * FROM test_1"
)
)
node.query("DROP TABLE test_1 SYNC")
node.query("DROP TABLE IF EXISTS test_2")
node.query(
"""
create table test_2 (a Int32)
engine = MergeTree()
order by tuple()
settings
disk=disk(
name='not_uniq_disk_name',
type = object_storage,
object_storage_type = local_blob_storage,
path='./03215_data_test_2/')
"""
)
node.query("INSERT INTO test_2 VALUES (1)")
node.query("SYSTEM FLUSH LOGS;")
print(
node.query(
"SELECT 'test_2', * FROM system.blob_storage_log"
)
)
print(
node.query(
"SELECT 'test_2', * FROM test_2"
)
)
node.restart_clickhouse()
print(
node.query(
"SELECT 'test_2', * FROM system.blob_storage_log"
)
)
print(
node.query(
"SELECT 'test_2', * FROM test_2"
)
)