Merge pull request #52823 from ClickHouse/try-fix-test_version_update_after_mutation

Try to remove more leftovers.
This commit is contained in:
Nikolai Kochetov 2023-07-31 22:22:18 +02:00 committed by GitHub
commit 15c77afd8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 26 deletions

View File

@ -3199,7 +3199,6 @@ class ClickHouseInstance:
):
self.name = name
self.base_cmd = cluster.base_cmd
self.base_dir = base_path
self.docker_id = cluster.get_instance_docker_id(self.name)
self.cluster = cluster
self.hostname = hostname if hostname is not None else self.name
@ -4194,14 +4193,6 @@ class ClickHouseInstance:
["bash", "-c", f"sed -i 's/{replace}/{replacement}/g' {path_to_config}"]
)
def put_users_config(self, config_path):
"""Put new config (useful if you cannot put it at the start)"""
instance_config_dir = p.abspath(p.join(self.path, "configs"))
users_d_dir = p.abspath(p.join(instance_config_dir, "users.d"))
config_path = p.join(self.base_dir, config_path)
shutil.copy(config_path, users_d_dir)
def create_dir(self):
"""Create the instance directory and all the needed files there."""

View File

@ -1,7 +0,0 @@
<clickhouse>
<profiles>
<default>
<force_remove_data_recursively_on_drop>1</force_remove_data_recursively_on_drop>
</default>
</profiles>
</clickhouse>

View File

@ -51,12 +51,6 @@ def start_cluster():
cluster.shutdown()
def restart_node(node):
# set force_remove_data_recursively_on_drop (cannot be done before, because the version is too old)
node.put_users_config("configs/force_remove_data_recursively_on_drop.xml")
node.restart_with_latest_version(signal=9, fix_metadata=True)
def test_mutate_and_upgrade(start_cluster):
for node in [node1, node2]:
node.query("DROP TABLE IF EXISTS mt")
@ -73,9 +67,10 @@ def test_mutate_and_upgrade(start_cluster):
node2.query("DETACH TABLE mt") # stop being leader
node1.query("DETACH TABLE mt") # stop being leader
restart_node(node1)
restart_node(node2)
node1.query("SYSTEM FLUSH LOGS")
node2.query("SYSTEM FLUSH LOGS")
node1.restart_with_latest_version(signal=9, fix_metadata=True)
node2.restart_with_latest_version(signal=9, fix_metadata=True)
# After hard restart table can be in readonly mode
exec_query_with_retry(
@ -131,7 +126,7 @@ def test_upgrade_while_mutation(start_cluster):
# (We could be in process of creating some system table, which will leave empty directory on restart,
# so when we start moving system tables from ordinary to atomic db, it will complain about some undeleted files)
node3.query("SYSTEM FLUSH LOGS")
restart_node(node3)
node3.restart_with_latest_version(signal=9, fix_metadata=True)
# checks for readonly
exec_query_with_retry(node3, "OPTIMIZE TABLE mt1", sleep_time=5, retry_count=60)