How to add new column to replicated clickhouse table on production without downtime? #48613
-
I have 3 node clickhouse production cluster with approx under 1TB of data. According to documentation:
How clickhouse in production should be upgraded:
Is there way to do it in stages without causing downtime and hanging on inserts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's not quite true. Usually Alter blocks the table (and inserts/select) for the very short time, ~millisecond, to change table metadata. In some sophisticated cases
Just execute a rolling upgrade, one by one node of clickhouse. Some selects and inserts may fail because when they are interrupted by a node shutdown. |
Beta Was this translation helpful? Give feedback.
It's not quite true. Usually
add column
is instant and blocks nothing and waits for nothing. You can executeadd column
without the interruption inserts and queries.Alter blocks the table (and inserts/select) for the very short time, ~millisecond, to change table metadata.
In some sophisticated cases
alter add column
can wait for thedrop column
, but during that time it does not hold the table lock, so it does not blocks inserts and selects.Just execute a rolling upgrade, one by one node of clickhouse. Some selects and inserts may fail because when they are interrupted by a node shutdown.