v.24.8Improvement

Ignore async_load_databases for ATTACH query

Ignore async_load_databases for ATTACH query (previously it was possible for ATTACH to return before the tables had been attached). #66240 (Azat Khuzhin).
Improved ATTACH query behavior by ignoring the async_load_databases setting, ensuring that the query only returns after all tables have been fully attached.

Why it matters

Previously, the ATTACH query could return before all tables were actually attached due to the asynchronous loading controlled by async_load_databases. This could cause inconsistencies or race conditions when users expected the tables to be ready immediately after the ATTACH command. Ignoring async_load_databases for ATTACH queries ensures synchronous completion, improving reliability and predictability of table attachment.

How to use it

No additional configuration is needed. When you execute an ATTACH query, ClickHouse now automatically ignores the async_load_databases setting, and the query will return only once all tables are attached synchronously.