v.21.6Improvement

Flush Buffer Tables Before Database Shutdown to Prevent Data Loss

Flush Buffer tables before shutting down tables (within one database), to avoid discarding blocks due to underlying table had been already detached (and Destination table default.a_data_01870 doesn't exist. Block of data is discarded error in the log). #24067 (Azat Khuzhin).
Flush Buffer tables before shutting down tables within a single database to prevent data loss errors related to detached underlying tables.

Why it matters

This feature addresses the issue where blocks of data are discarded due to the underlying destination table being detached before the Buffer table is flushed, resulting in errors such as Destination table default.a_data_01870 doesn't exist. Block of data is discarded. By ensuring flushes occur before shutdown, data integrity is maintained and log errors are avoided.

How to use it

The flushing of Buffer tables before table shutdown is performed automatically by ClickHouse during the shutdown process of tables within the same database. No additional user configuration is required.