api: an Application watch resumed from a WorkloadMonitor version can skip HelmRelease changes of other applications

Abierto
#5,324 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, kubernetes
Área
api, backend

Línea de trabajo

Start with REST.Watch in pkg/registry/apps/application/rest.go, where the HelmRelease and WorkloadMonitor watches are merged and the client's resourceVersion is replayed and filtered. Read how the merged stream orders events and how the HelmRelease watch is reopened on resume. Done means a reconnect after a WorkloadMonitor event cannot skip a HelmRelease change, which needs a design decision between ordering across streams and opening the backing watches from the client's resourceVersion.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

triage/needs-triage

Where

pkg/registry/apps/application/rest.go, REST.Watch.

Problem

An Application watch merges two backing watches: HelmReleases and WorkloadMonitors. Events from the two streams reach the client in whatever order they arrive, and a WorkloadMonitor-triggered event carries a resourceVersion at least as new as the monitor's. A client-go reflector records the resourceVersion of every event it receives as its resume point, whatever object the event is for, and passes it back when it reconnects.

The backing HelmRelease watch is opened without the client's resourceVersion, and resume is emulated by replaying every release as ADDED and skipping those whose resourceVersion is not above the client's.

Sequence:

  1. Application A's HelmRelease is written at revision 100; the event has not been delivered on the HelmRelease stream yet.
  2. Application B's WorkloadMonitor is written at revision 101, and its event is delivered first.
  3. The client records 101 and the connection drops.
  4. On reconnect the replay of A at 100 is skipped as already seen, and the client keeps A's previous spec until A changes again or the client relists.

Impact

Rare: it needs a disconnect inside the window between the two deliveries. When it happens, the stale object stays in the client's cache with no error.

Possible directions

  • Deliver events in revision order across both streams, holding a monitor event until the HelmRelease stream has progressed past its revision (for example via a progress bookmark from the backing watch).
  • Open the backing watches from the client's resourceVersion instead of replaying and filtering, so the server, not the merge, decides what the client has seen. This alone does not fix the ordering across the two streams.
Lenguaje dominante
Go
Estrellas
2.2k
Forks
209
Merge medio
4 d 14 h
PR fusionados (30 d)
140

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cozystack/cozystack

Todos los issues de cozystack/cozystack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.