StatefulSet stays deleted after a rejected create in the Recreate fallback: no retry until the operator restarts
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, kubernetes
- Ambito
- infrastructure
Direzione di ricerca
Start in statefulset-reconciler.go at shouldAbortOrContinueCreateStatefulSet (around line 442) and doCreateStatefulSet (around line 469), then trace how the Update -> Recreate path at updateStatefulSet (around line 337) propagates the create error up through worker-reconciler-chi.go:989 and worker.go:482. Reproduce with the linked kind script, focusing on why the failed create is treated as terminal instead of triggering a later reconcile/retry. Done looks like the missing StatefulSet being recreated after the webhook recovers, without an operator restart, and a regression test or repeatable repro covering the Recreate fallback.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When the Update -> Recreate fallback deletes a StatefulSet and the following create is rejected (here by an admission webhook that fails), the StatefulSet stays deleted. The rejection is temporary, but the operator does not retry after it ends. Only an operator restart brought the StatefulSet back in our test.
#1990, #1995 and #2086 fixed the reporting of this failure: the CHI now ends as Aborted instead of Completed. The host is still lost, and nothing recovers it.
Versions
- clickhouse-operator 0.27.4 (
masterhas the sameshouldAbortOrContinueCreateStatefulSetcode) - kind v0.31.0 (Kubernetes v1.35.0), ClickHouse 25.8
Steps to reproduce
Full repro in a throwaway kind cluster (about 6 minutes): https://gist.github.com/valner/54b06148a436bb7489d711eee916f39f. Run bash repro.sh. The script does the following:
- Deploys a CHI with 1 shard and 2 replicas and waits for
Completed. - Installs a validating webhook with
failurePolicy: Fail. Its Service has no endpoints, so every call fails, and the selector limits this to the create ofchi-repro-default-0-1. - Adds a label to the CHI. The label is copied to the StatefulSet
volumeClaimTemplates, which makes the next updateForbidden. - Restarts the operator. The reconcile recreates
0-0, deletes0-1, and the create of0-1fails. - Deletes the webhook and waits 120 seconds.
Expected
The operator retries the create after a failed reconcile, and the StatefulSet comes back once the webhook works again.
Actual
- CHI status is
Aborted. status.hostsis 2, but only 1 StatefulSet exists.- 15 minutes after the webhook is deleted, the StatefulSet is still missing.
- The operator logged no
reconcileCRlines in the last 13 of those minutes.
Log:
E statefulset-reconciler.go:530] doUpdateStatefulSet():Host:0-1[0/1]:repro/repro:StatefulSet update failed. err: StatefulSet.apps "chi-repro-default-0-1" is invalid: spec: Forbidden: updates to statefulset spec for fields other than ...
I statefulset-reconciler.go:337] updateStatefulSet():Host:0-1[0/1]:repro/repro:Update StatefulSet(repro/chi-repro-default-0-1) switch from Update to Recreate
E statefulset-reconciler.go:469] doCreateStatefulSet():Host:0-1[0/1]:repro/repro:StatefulSet create failed. err: Internal error occurred: failed calling webhook "sts-create.chop-repro.local": ...
E statefulset-reconciler.go:442] shouldAbortOrContinueCreateStatefulSet():Host:0-1[0/1]:repro/repro:Create StatefulSet: repro/chi-repro-default-0-1 - failed and needs recreate; propagating as error
W worker-reconciler-chi.go:989] first shard failed, skipping rest of shards due to an error: crud error - should recreate
W worker.go:482] markReconcileCompletedUnsuccessfully():CHI:repro/repro:reconcile completed UNSUCCESSFULLY, task id: ...
The PVC of the lost host stays, so the data is kept. The replica is down until someone acts.
Workaround
Restart the operator when a CHI is Aborted. A CronJob doing this brought the StatefulSet back in our test.
- Lingua principale
- Go
- Stelle
- 2.6k
- Fork
- 584
- Merge medio
- 3g 11h
- PR unite (30g)
- 7
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 Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Altinity/clickhouse-operator#2093 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Altinity/clickhouse-operator#2129 ·
I maintainer di solito rispondono entro 1 giorno
-
Adding a disk restarts ClickHouse in place before the pod has the new volume mountForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Altinity/clickhouse-operator#2121 ·
I maintainer di solito rispondono entro 1 giorno
-
CHK discovery lists fail with "unknown namespace for the cache" when watch.namespaces is unset (0.27.4)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
Altinity/clickhouse-operator#2117 ·
I maintainer di solito rispondono entro 1 giorno
-
CHK reconciles in a tight loop after its first Completed; with `onKeeperResourceUpdate: reconcile` the dependent CHI never finishes (0.27.4)Forse già presa @Tyagiquamar l’ha presa 12 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
Altinity/clickhouse-operator#2107 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Altinity/clickhouse-operator
Issue simili
-
bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
[mesheryctl] design delete fails when passing file or URL as positional argumentForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertacomponent/mesheryctl kind/bug language/go
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
meshery/meshery#22772 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
backend security size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
limitlessprojects/Go-Hybrid#3342 ·
I maintainer di solito rispondono entro 1 giorno
-
status/ready type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
buildpacks/pack#2733 ·
I maintainer di solito rispondono entro 1 giorno