Make kubevirt-datamover cluster-wide singleton check safe under concurrent DPA reconciles
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go, kubernetes
- Área
- infrastructure
Línea de trabajo
Start in internal/controller/kubevirt_datamover_controller.go with checkKubevirtDatamoverClusterSingleton(), its call in ValidateDataProtectionCR, and ReconcileKubevirtDatamoverController around the CreateOrUpdate. Also check SetupWithManager for MaxConcurrentReconciles, which is currently left at the default of 1. The issue is conditional on future concurrency, so confirm with a maintainer before starting. Done means a lock held across the re-check and create, with the unlocked validator call kept.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
The kubevirt-datamover controller is a cluster-wide singleton: only one DPA across all namespaces may have the plugin enabled with a deployed controller. Enforcement lives in checkKubevirtDatamoverClusterSingleton() (internal/controller/kubevirt_datamover_controller.go), called from ValidateDataProtectionCR during the DPA reconcile batch.
The check-then-act sequence — validate early in the batch, create the Deployment much later in ReconcileKubevirtDatamoverController — has a TOCTOU window: two DPAs in different namespaces could both pass validation while neither deployment exists yet, and both end up deployed.
Why it is safe today
MaxConcurrentReconciles is never overridden in SetupWithManager, so it stays at controller-runtime's default of 1: Reconcile() calls for every DPA across every namespace are fully serialized, and the race cannot occur. This reliance is documented inline on SetupWithManager and on the check itself.
With multi-tenant DPA (one DPA per namespace, #2488) there is more reason than before to eventually raise reconcile concurrency for throughput.
What to do when concurrency is raised
Re-run checkKubevirtDatamoverClusterSingleton() under a mutex immediately before the CreateOrUpdate in ReconcileKubevirtDatamoverController (keep the unlocked call in the validator for fast feedback), and hold the lock across the create. This design was prototyped and live-tested during #2488 and then removed as defense-in-depth against a race that cannot occur under the current serialized configuration — see the PR's design doc for the full analysis, including why a lock spanning batch steps would be wrong (the batch aborts on intermediate errors and would hold the lock indefinitely).
Note a mutex only helps while leader election guarantees a single active controller replica, which is the case today.
Note: Posted using claude code
Model: GLM 5.3
- Lenguaje dominante
- Go
- Estrellas
- 93
- Forks
- 93
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 26
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 openshift/oadp-operator
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openshift/oadp-operator#2372 ·
Los mantenedores suelen responder en 1 día
-
Makefile container tool check only verifies binary exists, not runtime readinessPosiblemente ocupada @Shreyashxredhat la tomó hace 112 días. Abiertolifecycle/rotten
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openshift/oadp-operator#2249 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
tide/merge-blocker
Dificultad 1/5 Menos de una hora Aptitud para principiantes 10/100
openshift/oadp-operator#2501 ·
Los mantenedores suelen responder en 1 día
-
Follow up on NetworkPolicy review nits from PR #2494Posiblemente ocupada @kaovilai la tomó hace 5 días. Abierto
openshift/oadp-operator#2495 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
KubeVirt datamover controller: hardcoded 128Mi/500m resources and 1s probes too small at scale; not configurable via DPAPosiblemente ocupada @kaovilai la tomó hace 9 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
openshift/oadp-operator#2481 ·
Los mantenedores suelen responder en 1 día
Todos los issues de openshift/oadp-operator
Issues similares
-
automation models
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mvanhorn/cli-printing-press#5146 ·
Los mantenedores suelen responder en 1 día
-
.jsonc files are skippedAbiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
alibaba/open-code-review#1800 ·
Los mantenedores suelen responder en 1 día
-
kind/engineering needs-triage pulumi/registry R2 S2 Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día