Adding a disk restarts ClickHouse in place before the pod has the new volume mount
I maintainer di solito rispondono entro 2 giorni
Una pull request collegata è già stata integrata.
- #2122 di @lizardoluis — integrata
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start in the Go reconciliation path at reconcileHostStatefulSet, then inspect shouldForceRestartHost and hostRequiresStatefulSetRollout to understand why a new volume mount does not defer the restart. Review the failing e2e test test_010036 and the related ordering issue #1926. Done means the StatefulSet rollout gives the pod its new mount before ClickHouse restarts, with the regression covered by a passing test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When a disk is added to a running ClickHouseInstallation, the operator restarts ClickHouse in place before the pod has the new volume mount. The new storage_configuration is already in the ConfigMap, so ClickHouse starts looking for a directory that does not exist in the pod yet. On ClickHouse 26.7+ that aborts startup and the pod crash-loops until the StatefulSet rollout catches up. On 26.3 the same sequence is tolerated, which is why it goes unnoticed there.
This is the same ordering problem as #1926 (ConfigMap updated, then SYSTEM SHUTDOWN, then the StatefulSet), but triggered by a volume mount instead of an image change.
Cause
In reconcileHostStatefulSet the config is updated, then shouldForceRestartHost triggers the in-place restart (hostSoftwareRestart), and only afterwards the StatefulSet is rolled out. The restart is skipped only when hostRequiresStatefulSetRollout returns true, and that function compares just the container Env. A new volumeMounts entry is not a reason to skip it.
To Reproduce
- Operator 0.27.4 (also present on
0.28.0andmaster), ClickHouse 26.8, a CHI withstorageManagement.provisioner: Operatorand a defaultvolumeClaimTemplate. - Update the CHI to add a second
volumeClaimTemplate, avolumeMountsentry for it in the pod template (/var/lib/clickhouse2), andstorage_configuration/disks/disk2/path: /var/lib/clickhouse2/inconfiguration.settings. - The operator logs
Host software restart start, the pod restarts, and ClickHouse exits withPATH_ACCESS_DENIEDon/var/lib/clickhouse2. The pod goes intoCrashLoopBackOffuntil the rollout recreates it.
The e2e test test_010036 fails this way on 26.8 and passes on 26.3.
Expected behavior
The operator rolls the pod out first, so the restarted ClickHouse already has the mount.
Environment
- Operator 0.27.4
- ClickHouse 26.8 (fails), 26.3 (passes)
- Kubernetes 1.33 (minikube)
Additional context
ClickHouse 26.7+ treating the missing directory as fatal is a regression on the server side. I reported it at ClickHouse/ClickHouse#127938.
- Lingua principale
- Go
- Stelle
- 2.6k
- Fork
- 584
- Merge medio
- 5g 10h
- PR unite (30g)
- 11
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 26 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
-
Metrics exporter publishes NaN for per CPU, disk and network metrics on ClickHouse 26.8Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Altinity/clickhouse-operator#2135 ·
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
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Altinity/clickhouse-operator#2126 ·
I maintainer di solito rispondono entro 2 giorni
-
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 2 giorni
Tutte le issue di Altinity/clickhouse-operator
Issue simili
-
mqtt_paho: transformer.DeleteExtension and DeleteAttribute make WritePubMessage failForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
cloudevents/sdk-go#1349 ·
-
getChaosHub always returns totalFaults "0"Forse già presa @Aryanbhargava18 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
litmuschaos/litmus#5710 ·
I maintainer di solito rispondono entro 3 giorni
-
vtselect: data race in Tempo search tags APIs for invalid TraceQL queriesForse già presa @Shubham19032004 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VictoriaMetrics/VictoriaTraces#304 ·
I maintainer di solito rispondono entro 1 giorno
-
kn secret create --tls-cert creates the certificate under the wrong keyForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno
-
Routing rule or circuit breaker trip expression with an unknown CEL function hangs daprdForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno