Recovered replica rejoins the CHI service before it catches up after a lost volume
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, kubernetes
調査の方向性
Start with shouldWaitReplicationHost in pkg/controller/chi/worker-wait-exclude-include-restart.go and trace how lost-volume recovery updates status.hostsWithReplicaCaughtUp and the first-host check. Compare those paths with the new-replica wait behavior and related issues #2018 and #2096. Done when recovered replicas with shard peers holding data wait for catch-up before joining the service, including the first host case.
索引モデルが issue の本文から書いたものです。
説明
Summary
After a lost-volume recovery, the operator includes the recovered host and labels its pod clickhouse.altinity.com/ready=yes right after the tables are created, so the CHI service sends queries to a replica that is still fetching parts. reconcile.host.wait.replicas.new: yes does not cover this case.
Versions
- clickhouse-operator 0.25.6; the same logic is in 0.27.4 and master
- ClickHouse 26.1.12, 1 shard × 3 replicas, StatefulSet provisioner
reconcile.host.wait.replicas: {all: no, new: yes, delay: 10},reconcile.host.drop.replicas.onLostVolume: yes
What happens
shouldWaitReplicationHost in pkg/controller/chi/worker-wait-exclude-include-restart.go takes an early exit for a recovered host in both of these cases:
- A host other than the first: its StatefulSet already exists, so the host is not
ObjectStatusCreated. The check then finds the host instatus.hostsWithReplicaCaughtUp, written before the volume was lost, and logsReplica is already listed as caught, no need to catch-up again. - The first host in the cluster:
IsFirstInCluster()returns before anywait.replicassetting is read, so not evenall: yesmakes it wait.
We replaced the volumes of all three replicas one at a time. Replicas 0-2 and 0-1 each joined the service with about 300 GiB of parts still to fetch, and 0-2 answered 44 client queries in the two minutes before we removed the label by hand.
Expected
A host whose volume was lost waits for catch-up the way a new replica does: its entry in hostsWithReplicaCaughtUp is cleared when data loss is detected, and the first-in-cluster exemption does not apply while other replicas of the shard hold the data.
Related
- #1567: a new replica is added to the service endpoint immediately
- #2018: opt-in sync gate that clears stale caught-up markers on data-loss paths when enabled
- #2096: lost-volume recovery of the shard's first host drops nothing
Workaround
Remove the ready label from the recovered pod each time it is set, and add it back once system.replicas shows the copies equal.
- 主要言語
- Go
- スター
- 2.6k
- フォーク
- 588
- 平均マージ
- 4日 5時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Altinity/clickhouse-operator のほかの issue
-
Counter metrics are missing the conventional _total suffix再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Altinity/clickhouse-operator#2093 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
ClickHouseBackup CR provides no way to configure pod labels/attributes and other fields対応中かも @Slach が 3 日前に担当しました。 オープン
Altinity/clickhouse-operator#2141 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Metrics exporter publishes NaN for per CPU, disk and network metrics on ClickHouse 26.8対応中かも @Slach が 2 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Altinity/clickhouse-operator#2135 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Rebuilt replica gets no tables when reading the schema from peers fails対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Altinity/clickhouse-operator#2129 ·
メンテナーはふだん 2 日以内に返信
-
StatefulSet stays deleted after a rejected create in the Recreate fallback: no retry until the operator restarts対応中かも @Slach が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Altinity/clickhouse-operator#2126 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
Altinity/clickhouse-operator の issue をすべて見る
似ている issue
-
agent-butler-finding chore
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
jordansmall/spindrift#6695 ·
メンテナーはふだん 1 日以内に返信
-
skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
kagent-dev/kagent#3571 ·
メンテナーはふだん 1 日以内に返信
-
book-layout.spec fails when the similar-books rail holds other projects' books対応中かも @praetorianer777 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
praetorianer777/GoTome#373 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeout対応中かも @floriankoch が今日担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
envoyproxy/gateway#10562 ·
メンテナーはふだん 1 日以内に返信