Adding a disk restarts ClickHouse in place before the pod has the new volume mount
Los mantenedores suelen responder en 2 días
Ya se ha fusionado un pull request relacionado.
- #2122 de @lizardoluis — fusionado
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 2.6k
- Forks
- 584
- Merge medio
- 5 d 22 min
- PR fusionados (30 d)
- 12
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Altinity/clickhouse-operator
-
Counter metrics are missing the conventional _total suffixPosiblemente ocupada @mehrdadbn9 la tomó hace 28 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Altinity/clickhouse-operator#2093 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
ClickHouseBackup CR provides no way to configure pod labels/attributes and other fieldsPosiblemente ocupada @Slach la tomó hace 1 día. Abierto
Altinity/clickhouse-operator#2141 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Altinity/clickhouse-operator#2140 ·
Los mantenedores suelen responder en 2 días
-
Metrics exporter publishes NaN for per CPU, disk and network metrics on ClickHouse 26.8Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Altinity/clickhouse-operator#2135 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Altinity/clickhouse-operator#2129 ·
Los mantenedores suelen responder en 2 días
Todos los issues de Altinity/clickhouse-operator
Issues similares
-
agent-butler-finding bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
jordansmall/spindrift#6414 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Icinga/icinga-kubernetes#294 ·
Los mantenedores suelen responder en 4 días
-
Cluster details: the Control Plane version field has a different border color than its icon boxAbiertokind/design sig/ui
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
kubermatic/dashboard#8449 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cli/cli#14962 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Model conformance driftAbiertomodel-drift
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día