v.20.4New Feature

ClickHouse Adds Timeout Control for Dictionary Sources

Now ClickHouse controls timeouts of dictionary sources on its side. Two new settings added to cache dictionary configuration: strict_max_lifetime_seconds, which is max_lifetime by default, and query_wait_timeout_milliseconds, which is one minute by default. The first settings is also useful with allow_read_expired_keys settings (to forbid reading very expired keys). #10337 (Nikita Mikhaylov)
ClickHouse now manages timeouts for dictionary sources internally with two new settings: strict_max_lifetime_seconds and query_wait_timeout_milliseconds, improving control over dictionary cache expiration and query waiting time.

Why it matters

This feature addresses the need for better control over dictionary cache validity and query waiting behavior by enforcing stricter lifetime limits and limiting how long queries can wait for dictionary updates, thus preventing reading very expired keys and improving system stability.

How to use it

To apply this feature, configure the dictionary cache with the new settings in the dictionary configuration file. Use strict_max_lifetime_seconds to set the maximum allowed lifetime for dictionary data (defaulting to max_lifetime). Adjust query_wait_timeout_milliseconds to control how long queries wait for freshness (default is one minute). These settings complement the allow_read_expired_keys option to manage key expiration behavior.