Reduce stage log Put allocation overhead in filestore persistence
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Comienza en pkg/app/server/stagelogstore/filestore.go leyendo stageLogFileStore.Put alrededor de las líneas 65-82 y su TODO de rendimiento. Añade el benchmark enfocado descrito en el issue para lf.Blocks crecientes, y después compara las asignaciones y el coste de escritura mientras compruebas el comportamiento de lectura existente. Se considera terminado cuando haya una mejora medible, se conserven el formato delimitado por líneas y el marcador EOL, y no se produzcan cambios de comportamiento no relacionados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened:
Summary
stageLogFileStore.Put rewrites the entire stage-log fragment on every save by JSON-encoding each LogBlock into a fresh in-memory buffer and then writing the full byte slice to the filestore. The code already carries a TODO for this hot path, and the current implementation scales allocations and latency with total block count on every write.
Affected Area
pkg/app/server/stagelogstore/filestore.go- stage log persistence in the control plane filestore path
What you expected to happen:
Large or frequently updated stage logs should be persisted with lower peak allocation overhead and an encoding path that does not materialize avoidable intermediate payloads for every block.
How to reproduce it:
- Open
pkg/app/server/stagelogstore/filestore.go. - Inspect
stageLogFileStore.Putaround the existing performance TODO. - Note that each call loops over all
lf.Blocks, marshals each block individually, appends it to abytes.Buffer, and finally callsfilestore.Putwith the complete byte slice. - Add a focused benchmark that grows
lf.Blocksand repeatedly callsPut. - Observe allocation count and write cost grow with total block count because the full fragment is rebuilt for every save.
Environment:
pipedversion: repository checkout on 2026-07-13control-planeversion: repository checkout on 2026-07-13- Others: validated by current code inspection; previous related issue
#40was closed as stale, not fixed
Technical Evidence
pkg/app/server/stagelogstore/filestore.go:65-82rebuilds the payload in memory for everyPut- The code includes
TODO: Reduce the number of marshaling log blocks for improving performance - Upstream issue
#40tracked the same performance concern but was auto-closed as stale without an implementation change
Suspected Root Cause
The filestore path is implemented as full-object persistence, and Put currently uses per-block json.Marshal calls plus a whole-fragment buffer build before every write.
Proposed Direction
Start with a benchmark for realistic stage-log sizes, then refactor the write path to stream JSON encoding into the final buffer or otherwise reduce avoidable intermediate allocations while preserving the existing line-delimited on-disk format and EOL completion marker.
Acceptance Criteria
- A benchmark captures baseline throughput and allocations for larger stage-log fragments
- The write path measurably reduces allocations or latency compared with the current implementation
- Existing read compatibility for stored stage logs is preserved
- No unrelated stage-log behavior changes are introduced
- Lenguaje dominante
- Go
- Estrellas
- 1.4k
- Forks
- 391
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 58
Preparar el entorno
- Sin Dockerfile ni 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 pipe-cd/pipecd
-
Applications at the repository root are not triggered by new commitsPosiblemente ocupada @Daksha1611 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 2 días
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTINGPosiblemente ocupada @Dhirenderchoudhary la tomó hoy. Abierto
Dificultad 2/5 Medio día Aptitud para principiantes 74/100
pipe-cd/pipecd#7626 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
pipectl transfer restore application drops backed-up labelsPosiblemente ocupada @bhavishyajain545 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
pipe-cd/pipecd#7622 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
Todos los issues de pipe-cd/pipecd
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
docker-compose: postgres healthcheck should probe TCP (pg_isready -h localhost)Posiblemente ocupada @zezo-mohamed22 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
OneBusAway/watchdog#305 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
self-care self-care:agent-discoverability
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
githubnext/gh-cao#20928 ·
Los mantenedores suelen responder en 1 día
-
automation documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
SocialGouv/iterion#3287 ·
Los mantenedores suelen responder en 1 día