How ClickHouse Replication Queues Work: Each Replica Manages Its Own Task List

A developer testing CH-Ops, an admin GUI for self-hosted ClickHouse, discovered unexpected behavior while experimenting with a one-shard, two-replica setup. After stopping one node and inserting data through the other, the downed node showed pending replication tasks while the active node's queue appeared empty. This counterintuitive result revealed that ClickHouse replication queues are per-replica, not cluster-wide — each replica maintains its own local to-do list derived from a shared log stored in ClickHouse Keeper. When a replicated operation occurs, Keeper logs it and each replica independently determines what actions it needs to take to catch up. The system.replicas table exposes per-replica queue details, including breakdowns by insert, merge, and mutation task types, making it a key tool for monitoring replication health.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in