v.21.3Improvement

Improvement to MaxDDLEntryID Initialization in system.distributed_ddl_queue Table

Improvement for the system.distributed_ddl_queue table. Initialize MaxDDLEntryID to the last value after restarting. Before this PR, MaxDDLEntryID will remain zero until a new DDLTask is processed. #19924 (Amos Bird).
Improvement to the system.distributed_ddl_queue table to initialize MaxDDLEntryID with the last processed value after a server restart.

Why it matters

Previously, after restarting ClickHouse, the MaxDDLEntryID value in system.distributed_ddl_queue would reset to zero until a new DDL task was processed. This could cause confusion or delay in tracking the progress of distributed DDL tasks. This improvement ensures that MaxDDLEntryID is correctly initialized to the last known value, providing accurate state and better reliability in distributed DDL management.

How to use it

This feature is applied automatically after upgrading to the new ClickHouse version including this improvement. No additional user action is required to enable it. The system.distributed_ddl_queue table will now initialize MaxDDLEntryID from the last recorded entry on server start.