v.21.6Improvement
Respect lock_acquire_timeout_for_background_operations for OPTIMIZE queries
Respectlock_acquire_timeout_for_background_operationsforOPTIMIZEqueries. #23623 (Azat Khuzhin).
Why it matters
This feature preventsOPTIMIZE queries from waiting indefinitely or too long to acquire necessary locks during background operations, improving system responsiveness and avoiding potential delays caused by lock contention.How to use it
Set thelock_acquire_timeout_for_background_operations parameter to the desired timeout duration. This timeout will then be applied when executing OPTIMIZE queries, controlling how long they wait to acquire locks before timing out.