v.24.6Improvement

Forbid converting MergeTree table to replicated if zookeeper path exists

Forbid converting a MergeTree table to replicated if the zookeeper path for this table already exists. #64244 (Kirill).
Prevent converting a MergeTree table to a ReplicatedMergeTree if the ZooKeeper path for the table already exists.

Why it matters

This feature addresses the risk of conflicts or data inconsistencies by forbidding the conversion of a non-replicated MergeTree table into a replicated table when the ZooKeeper path is already in use. It ensures data integrity and avoids accidental overwriting or corruption in replication setups.

How to use it

Users do not need to explicitly enable this feature. When attempting to convert a MergeTree table to a ReplicatedMergeTree, ClickHouse will automatically check for the existence of the ZooKeeper path and block the conversion if the path already exists.