Plan preview request routing scans all active pipeds
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
- #7088 di @rootp1 — chiusa senza merge
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- go
- Ambito
- api, performance
Direzione di ricerca
Inizia in pkg/app/server/grpcapi/api.go, in API.RequestPlanPreview, e analizza la chiamata a pipedStore.List e il ciclo di corrispondenza dei repository. Aggiungi un benchmark che copra quantità piccole e grandi di piped, quindi valuta una ricerca mirata, un indice o una cache limitata per le richieste ripetute. Il lavoro è completo quando il routing ripetuto evita le scansioni complete dei piped attivi, preservando al contempo risultati corretti quando corrispondono più piped.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened:
RequestPlanPreview currently lists all enabled pipeds in the project and scans every configured repository entry in memory to find pipeds that match the requested repository remote and base branch. This makes each interactive plan preview request scale with total active piped count and repository mappings instead of the number of matching pipeds.
Summary
Plan preview request routing performs an O(number of pipeds x repositories per piped) in-memory scan for every request.
Affected Area
pkg/app/server/grpcapi/api.go, specifically API.RequestPlanPreview.
Steps to Reproduce
- Create a test or benchmark environment with many active pipeds in one project and repository mappings on those pipeds.
- Call
API.RequestPlanPreviewrepeatedly for one repository remote and base branch. - Capture allocations and latency with
go test -benchor pprof. - Observe that request cost grows with total piped count rather than with the matching pipeds.
What you expected to happen:
Plan preview routing should avoid a full active-piped scan on every request. Repeated routing for a repository/base-branch pair should be close to O(matches), for example via an index, bounded cache, or targeted lookup.
Expected Behaviour
Routing a plan preview request should avoid repeated full scans and should keep behavior correct when multiple pipeds match the same repository and branch.
How to reproduce it:
- Seed or mock thousands of enabled pipeds for one project.
- Give only a subset a repository entry matching the plan preview request remote and base branch.
- Repeatedly call
RequestPlanPreviewfor that remote and branch. - Compare latency/allocations as piped count increases.
Actual Behaviour
Each request calls pipedStore.List with only ProjectId and Disabled=false filters, then iterates through every returned piped and every repository entry until it finds matching mappings.
Technical Evidence
In pkg/app/server/grpcapi/api.go, RequestPlanPreview lists enabled pipeds for the project and then builds a repositories map by checking each p.Repositories entry against req.RepoRemoteUrl and req.BaseBranch. The code also has a TODO noting that caching may be needed to reduce database load.
Suspected Root Cause
The API layer has no repository-to-piped routing index or cache, so it must perform repository matching after fetching all enabled pipeds.
Proposed Direction
Add a focused benchmark for plan preview routing at small and large piped cardinalities, then avoid repeated full scans by adding a bounded cache or another targeted lookup for repository-to-piped matches.
Acceptance Criteria
- A benchmark covering small and large piped counts is added.
- Repeated plan preview routing for the same project/repository/base-branch avoids repeated full active-piped scans.
- Correct behavior is preserved when multiple pipeds match the same repository and branch.
Environment:
pipedversion: Not applicablecontrol-planeversion: Currentmasterbranch- Others: Not applicable
- Lingua principale
- Go
- Stelle
- 1.4k
- Fork
- 391
- Merge medio
- 4g 1h
- PR unite (30g)
- 58
Preparare l'ambiente
- Nessun Dockerfile né 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 pipe-cd/pipecd
-
Applications at the repository root are not triggered by new commitsForse già presa @Daksha1611 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni
-
pipedv1 kubernetes plugins ignore trafficRouting.istio.host in K8S_TRAFFIC_ROUTINGForse già presa @Dhirenderchoudhary l’ha presa oggi. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 74/100
pipe-cd/pipecd#7626 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
pipectl transfer restore application drops backed-up labelsForse già presa @bhavishyajain545 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
pipe-cd/pipecd#7622 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di pipe-cd/pipecd
Issue simili
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
gtsteffaniak/filebrowser#3395 ·
I maintainer di solito rispondono entro 1 giorno
-
effort:s impact:low raised-by:worker risk:low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
medici-finance/assay#6496 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug require/reproduce require/severity
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100