v.22.8Improvement
Improved DDL Query Result Structure for Replicated Database and Metadata Consistency Fixes
Improved structure of DDL query result table forReplicateddatabase (separate columns with shard and replica name, more clear status) -CREATE TABLE ... ON CLUSTERqueries can be normalized on initiator first ifdistributed_ddl_entry_format_versionis set to 3 (default value). It means thatON CLUSTERqueries may not work if initiator does not belong to the cluster that specified in query. Fixes #37318, #39500 - IgnoreON CLUSTERclause if database isReplicatedand cluster name equals to database name. Related to #35570 - Miscellaneous minor fixes forReplicateddatabase engine - Check metadata consistency when starting upReplicateddatabase, start replica recovery in case of mismatch of local metadata and metadata in Keeper. Resolves #24880. #37198 (Alexander Tokmakov).
Why it matters
This update addresses clarity and reliability issues in managingReplicated databases. It separates shard and replica names in DDL query results for better status visibility, ensures ON CLUSTER queries normalize correctly on the initiating host (preventing failures when the initiator is not part of the target cluster), and improves metadata consistency by verifying and recovering replicas at startup. These changes fix multiple issues related to cluster management, metadata synchronization, and user experience when working with distributed DDL operations.How to use it
To enable improved normalization ofCREATE TABLE ... ON CLUSTER queries, set the setting distributed_ddl_entry_format_version to 3 (which is the default). The system will automatically ignore the ON CLUSTER clause if the database is Replicated and the cluster name equals the database name. The metadata consistency checks and automatic recovery are applied automatically during Replicated database startup, requiring no additional user action.