Skip to content

How to add new column to replicated clickhouse table on production without downtime? #48613

Closed Answered by den-crane
IdeaHunter asked this question in Q&A
Discussion options

You must be logged in to vote

According to documentation:

It's not quite true. Usually add column is instant and blocks nothing and waits for nothing. You can execute add 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 the drop column, but during that time it does not hold the table lock, so it does not blocks inserts and selects.

How clickhouse in production should be upgraded:

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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Cheppali-Reddy
Comment options

@IdeaHunter
Comment options

Answer selected by IdeaHunter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants