[Feature Request]: Bound PGBKCVOperation precombine table by in-memory size, not key count

Offen
#39,754 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #39767 von @Dharshika-11 — ohne Merge geschlossen

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
python

Rechercherichtung

Beginne in sdks/python/apache_beam/runners/worker/operations.py bei PGBKCVOperation und seinem TODO zur Begrenzung anhand der In-Memory-Größe. Vergleiche die verwandte PGBKOperation und prüfe, wie die Akkumulatoren Count, Mean, min, max und sum dargestellt werden. Als erledigt gilt die Aufgabe, wenn die Precombine-Tabelle anhand einer Schätzung der In-Memory-Größe begrenzt wird, statt sich nur auf die Anzahl der Schlüssel zu stützen, und dabei verpackte oder native Akkumulatoren berücksichtigt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

P3
What would you like to happen?

PGBKCVOperation (sdks/python/apache_beam/runners/worker/operations.py) caps its precombine table by key count (max_keys, default 100k / 1M for Count/Mean/min/max/sum), flushing ~10% of keys once the count is hit. The code already flags this as a stopgap:

# TODO(b/36567833): Bound by in-memory size rather than key count.

A fixed key-count cap is a poor memory proxy when accumulators vary in size, so workers can OOM well below max_keys (or flush needlessly when accumulators are tiny). Request: bound the table by estimated in-memory size instead of (or in addition to) key count.

Notes:

  • b/36567833 is a Google-internal Buganizer ref with no public page; this issue tracks it publicly.
  • Sibling PGBKOperation has the same shape (max_size = 10 * 1000 elements).
  • Sizing accurately is the hard part — sys.getsizeof undercounts wrapped/native (e.g. C-extension) accumulators; a coder-based or sampled-RSS estimate is likely needed.
Issue Priority

Priority: 3 (nice-to-have improvement)

Issue Components
  • Component: Python SDK
Vorherrschende Sprache
Java
Sterne
8.7k
Forks
4.8k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
371

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/beam

Alle Issues in apache/beam

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.