diff --git a/tests/integration/helpers/0_common_remove_cas_logs.xml b/tests/integration/helpers/0_common_remove_cas_logs.xml new file mode 100644 index 0000000000000..a9ee6e7146cc2 --- /dev/null +++ b/tests/integration/helpers/0_common_remove_cas_logs.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/integration/helpers/cluster.py b/tests/integration/helpers/cluster.py index e6e4523b73ec5..226859fc1baa6 100644 --- a/tests/integration/helpers/cluster.py +++ b/tests/integration/helpers/cluster.py @@ -2258,6 +2258,7 @@ def add_instance( ipv4_address=None, ipv6_address=None, with_installed_binary=False, + installed_binary_supports_cas_logs=False, external_dirs=None, tmpfs=None, mem_limit=None, @@ -2290,6 +2291,8 @@ def add_instance( with_zookeeper - if True, add ZooKeeper configuration to configs and ZooKeeper instances to the cluster. with_zookeeper_secure - if True, add ZooKeeper Secure configuration to configs and ZooKeeper instances to the cluster. extra_configs - config files cannot put into config.d and users.d + installed_binary_supports_cas_logs - with `with_installed_binary`, keep the `cas_log` and `cas_gc_log` + sections of the main config. The binaries of other images reject them as unknown elements. """ if self.is_up: @@ -2406,6 +2409,7 @@ def add_instance( ipv4_address=ipv4_address, ipv6_address=ipv6_address, with_installed_binary=with_installed_binary, + installed_binary_supports_cas_logs=installed_binary_supports_cas_logs, external_dirs=external_dirs, tmpfs=tmpfs or [], mem_limit=mem_limit, @@ -5191,6 +5195,7 @@ def __init__( ipv4_address=None, ipv6_address=None, with_installed_binary=False, + installed_binary_supports_cas_logs=False, external_dirs=None, tmpfs=None, mem_limit=None, @@ -5365,6 +5370,7 @@ def __init__( self.ipv4_address = ipv4_address self.ipv6_address = ipv6_address self.with_installed_binary = with_installed_binary + self.installed_binary_supports_cas_logs = installed_binary_supports_cas_logs self.is_up = False self.config_root_name = config_root_name self.docker_init_flag = use_docker_init_flag @@ -6572,6 +6578,12 @@ def write_embedded_config(name, dest_dir, fix_log_level=False): "0_common_min_cpu_busy_time.xml", self.config_d_dir ) + # The main config comes from this checkout and has the Antalya-only `cas_log` and `cas_gc_log` + # sections. The binary of an older or upstream image rejects them as unknown elements and does not start. + # The sections stay removed if `restart_with_latest_version` later switches the instance to the tested binary. + if self.with_installed_binary and not self.installed_binary_supports_cas_logs: + write_embedded_config("0_common_remove_cas_logs.xml", self.config_d_dir) + use_old_analyzer = os.environ.get("CLICKHOUSE_USE_OLD_ANALYZER") is not None use_distributed_plan = ( os.environ.get("CLICKHOUSE_USE_DISTRIBUTED_PLAN") is not None diff --git a/tests/integration/test_cas_ref_move_compat/test.py b/tests/integration/test_cas_ref_move_compat/test.py index 01f35f338fae0..c8f8f8707e80c 100644 --- a/tests/integration/test_cas_ref_move_compat/test.py +++ b/tests/integration/test_cas_ref_move_compat/test.py @@ -16,6 +16,7 @@ def start_cluster(): image="altinity/clickhouse-server", tag=OLD_TAG, with_installed_binary=True, + installed_binary_supports_cas_logs=True, with_rustfs=True, stay_alive=True, ) @@ -43,6 +44,8 @@ def test_old_pool_floor_and_old_reader(start_cluster): # Pool created by the old build (reader floor 1). old.query("CREATE TABLE t_old (a UInt64) ENGINE = MergeTree ORDER BY a SETTINGS storage_policy = 'cas_shared'") old.query("INSERT INTO t_old SELECT number FROM numbers(100)") + # The old build knows the CAS logs, so its instance keeps them (`installed_binary_supports_cas_logs`). + assert _count(old, "1") > 0 # The new build mounts it: the first writable mount raises the floor to 2 before any rename, so the # new build's first rename is already an owner move. The server is stopped while the disk config lands: