v.23.7New Feature

Added SYSTEM FLUSH ASYNC INSERT QUEUE Query and Server-Side Settings

Added query SYSTEM FLUSH ASYNC INSERT QUEUE which flushes all pending asynchronous inserts to the destination tables. Added a server-side setting async_insert_queue_flush_on_shutdown (true by default) which determines whether to flush queue of asynchronous inserts on graceful shutdown. Setting async_insert_threads is now a server-side setting. #49160 (Anton Popov).
Introduced the SYSTEM FLUSH ASYNC INSERT QUEUE query to manually flush all pending asynchronous inserts to destination tables, and added new server-side settings related to asynchronous inserts.

Why it matters

This feature enables users to control the flushing of pending asynchronous insert operations, ensuring data consistency and allowing graceful shutdowns by flushing queued inserts automatically. It improves reliability and manageability of asynchronous data insertion in ClickHouse.

How to use it

Use the query SYSTEM FLUSH ASYNC INSERT QUEUE to manually flush all pending asynchronous inserts. Control automatic flushing on graceful shutdown via the async_insert_queue_flush_on_shutdown server setting (enabled by default). Configure the async_insert_threads setting on the server side to manage the number of async insert threads.