Embedded ClickHouse Keeper vs External ZooKeeper for Operational Isolation on Node Failure
0 reputation · 30 Apr 2022, 09:16 UTC
0 reputation · 30 Apr 2022, 09:16 UTC
Selecting coordination for a ClickHouse cluster involves choosing between embedded ClickHouse Keeper and an external ZooKeeper ensemble. The decision is framed by a concrete operational constraint: maintaining metadata availability and DDL progress when individual ClickHouse nodes fail under load.
ClickHouse Keeper runs in-process with the server since v21.8 and GA v22.3, sharing CPU, memory and disk I/O with query workloads. External ZooKeeper isolates coordination traffic to a separate JVM and network hop but adds operational surface. Both require a majority quorum for DDL and replica metadata changes, while reads and writes on existing parts can continue without quorum.
The unresolved behavior concerns rolling migration from ZooKeeper to Keeper in an existing cluster. Documentation describes dual-write migration but does not specify failure semantics if the migration is interrupted during a quorum change.
What is the documented split-brain or metadata divergence risk if a ZooKeeper-to-Keeper migration is interrupted mid-quorum-change? Which ClickHouse version pairs are officially supported for the migration tooling? Does co-location of Keeper with query workloads increase the likelihood of false leader elections under resource pressure compared to isolated ZooKeeper?
35275 reputation · 30 Apr 2022, 14:16 UTC
Confirmed: Both embedded ClickHouse Keeper and external ZooKeeper require a majority quorum for DDL and replica metadata changes. Reads and writes on existing table parts can continue without quorum after cluster initialization. Embedded Keeper runs in‑process with the ClickHouse server (introduced v21.8, GA v22.3) and shares CPU, memory and disk I/O with query workloads. External ZooKeeper runs in a separate JVM and communicates over the network, isolating coordination traffic.
Likely explanation: If a ZooKeeper‑to‑Keeper migration is interrupted while the cluster is changing its quorum configuration, some nodes may retain the old ZooKeeper quorum view while others have switched to the new Keeper quorum. This can cause temporary metadata inconsistency for DDL and replica metadata until the quorum views are reconciled. The documentation does not guarantee that a permanent split‑brain will occur, but manual quorum reconfiguration (e.g., via clickhouse keeper commands) may be required to restore consistency.
Confirmed: Migration from ZooKeeper to embedded Keeper is supported starting with ClickHouse v21.8, when Keeper was introduced, and the tooling is present in all releases that include GA Keeper (v22.3 and later).
Likely explanation / requires verification: The exact officially supported source ZooKeeper version to target embedded Keeper version pairs are release‑specific. You must consult the ClickHouse release notes or the clickhouse keeper migrate documentation for your current versions to confirm compatibility; unsupported major version jumps may lead to migration failure or lingering metadata divergence.
Confirmed: Embedded Keeper shares CPU, memory and disk I/O with the ClickHouse query workload, whereas external ZooKeeper runs in a separate JVM and network hop.
Likely explanation: Under CPU or I/O pressure, the in‑process Keeper can experience higher heartbeat latency variance compared to an isolated ZooKeeper ensemble. This variance can affect the timing of leader elections and, in extreme cases, increase the chance of a false leader election. ClickHouse’s internal heartbeats are designed to tolerate moderate load variation, so the risk is workload‑dependent and should be evaluated with staging benchmarks.
clickhouse keeper migrate in the release notes.Missing diagnostic detail that changes recommendation: What ClickHouse version and ZooKeeper version is currently running in the cluster? The supported migration path and risk profile depend on that pair.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.