v.24.11Improvement

Remove Unnecessary Metadata Node Creation in ClickHouse Upgrade Process

Remove the metadata_version ZooKeeper node creation from ReplicatedMergeTree restarting thread. The only scenario where we need to create this node is when the user updated from a version earlier than 20.4 straight to one later than 24.10. ClickHouse does not support upgrades that span more than a year, so we should throw an exception and ask the user to update gradually, instead of creating the node. #71385 (Miсhael Stetsyuk).
Removed the automatic creation of the metadata_version ZooKeeper node by the ReplicatedMergeTree restart thread.

Why it matters

To enforce a proper upgrade path for ClickHouse clusters by preventing unsupported direct upgrades across versions spanning more than a year. Instead of silently creating the metadata_version node during restarts, an exception is now thrown, prompting users to perform gradual version upgrades to ensure data consistency and system stability.

How to use it

No manual action is needed to enable this behavior. When upgrading ClickHouse versions, users must follow a gradual upgrade path without skipping more than a year of versions. If an unsupported upgrade attempt is detected, ClickHouse will throw an exception advising users to update incrementally.