Recovered replica rejoins the CHI service before it catches up after a lost volume
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go, kubernetes
- Ambito
- backend, distributed-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 2.6k
- Fork
- 584
- Merge medio
- 4g 11h
- PR unite (30g)
- 15
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Altinity/clickhouse-operator
-
Counter metrics are missing the conventional _total suffixForse già presa @mehrdadbn9 l’ha presa 29 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Altinity/clickhouse-operator#2093 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
ClickHouseBackup CR provides no way to configure pod labels/attributes and other fieldsForse già presa @Slach l’ha presa 2 giorni fa. Aperta
Altinity/clickhouse-operator#2141 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Metrics exporter publishes NaN for per CPU, disk and network metrics on ClickHouse 26.8Forse già presa @Slach l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Altinity/clickhouse-operator#2135 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Altinity/clickhouse-operator#2129 ·
I maintainer di solito rispondono entro 2 giorni
-
StatefulSet stays deleted after a rejected create in the Recreate fallback: no retry until the operator restartsForse già presa @Slach l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Altinity/clickhouse-operator#2126 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di Altinity/clickhouse-operator
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
JakeChampion/lang#14392 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-butler-finding bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
jordansmall/spindrift#6557 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Custom tool truncation leaves unused stream copies openForse già presa @OUAO-FRANK l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
crmne/hyprmoncfg#114 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno