v.23.5Improvement

Added Settings for Delaying or Throwing ALTER Queries in ClickHouse

Added settings (number_of_mutations_to_delay, number_of_mutations_to_throw) to delay or throw ALTER queries that create mutations (ALTER UPDATE, ALTER DELETE, ALTER MODIFY COLUMN, ...) in case when table already has a lot of unfinished mutations. #49117 (Anton Popov).
Introduced two new settings, number_of_mutations_to_delay and number_of_mutations_to_throw, that control the handling of ALTER queries creating mutations in tables with many unfinished mutations.

Why it matters

These settings help prevent performance degradation and excessive mutation backlog by delaying or rejecting new ALTER UPDATE, ALTER DELETE, ALTER MODIFY COLUMN, and similar mutation-creating queries when a table already has many unfinished mutations.

How to use it

Set the values of number_of_mutations_to_delay and number_of_mutations_to_throw in the server configuration or session to specify thresholds for delaying or throwing ALTER mutation queries. When the number of unfinished mutations exceeds these thresholds, new mutation queries will be delayed or blocked accordingly.