benchi: s3 backlog is inflated by the destination count's own duration, so lag.py reports a false SATURATED

Aperta
#3,441 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
aws, bash, go, postgresql

Direzione di ricerca

Read scripts/lag.py and run.sh:364-366 to see how backlog is computed, then trace the ROWS_* and SRC_* sampling hooks in bench.yml (lines 428-703). Compare the three proposed fix shapes and their effect on throughput measurements; add the described skew fixture to scripts/test-lag.py. Done when the s3 measurement skew no longer causes a false SATURATED verdict and the fixture checks that case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What is wrong

runs.csv carries rows_before/rows_after (destination ground truth) and src_before/src_after (the source tables' change counters), and scripts/lag.py computes backlog as src - rows "at the same instants" (run.sh:364-366). They are not the same instant.

bench.yml emits them from separate hooks, and the source read comes last:

  • ROWS_BEFORE at lines 428 / 459 / 520 / 544 / 572, TS_BEFORE_MS + SRC_EVENTS_BEFORE + SRC_NET_BEFORE at line 598
  • ROWS_AFTER at lines 609 / 630 / 656 / 665 / 677, TS_AFTER_MS + SRC_EVENTS_AFTER + SRC_NET_AFTER at line 703

So src is sampled after the destination count has finished running. For a cheap count that is microseconds. For the s3 count it is seconds, because the count downloads the entire bucket:

aws --endpoint-url http://cdcparity-minio:9000 s3 cp --recursive s3://bench/ /tmp/s3dump --quiet
find /tmp/s3dump -type f -exec cat {} + | wc -l

The loader is live throughout. Every second the download takes, src advances by one second of offered load while rows does not, and backlog is inflated by rate x count_duration.

What it broke

Pass H (results-aws/20261130T090609-qualified-batch8192-latency) is the first latency pass to complete. lag.py refused a latency figure for all three s3 arms:

conduit-s3 — SATURATED: backlog grew 21,000 -> 65,000 (+44,000) during a 66s window
connect-s3 — SATURATED: backlog grew 10,000 -> 55,000 (+45,000) during a 66s window

That verdict is wrong. Pass G (results-aws/20261130T070532-qualified-batch8192, same code, same box) measures conduit-s3 at 49,551 rec/s and connect-s3 at 34,027 rec/s — four and three times the 12,000 rec/s offered in pass H. Neither arm can be saturated at a quarter of its measured throughput.

The evidence matches the skew and not saturation:

s3 arm file arm (cheap count)
backlog before (bucket freshly reset, count fast) 21,000 22,808
backlog after (957,000 rows in the bucket, count slow) 65,000 19,000
  • before-backlog agrees with the file arm; after-backlog does not, and the only thing that changed is bucket size
  • the inflation reproduces exactly across rounds: 65,000 / 62,000 / 65,000
  • 44,000 records at 11,966 rec/s is 3.7 s of download, the right order for 957,000 rows out of MinIO
  • connect-s3 shows the same shape with a different tool, so it is the counting method, not Conduit

What it does NOT break

Throughput. rows_delta / (ts_after - ts_before) uses only the destination counter and the two timestamps, and TS_AFTER_MS is read in the same hook as SRC_EVENTS_AFTER, after the count — so the window and the delta are consistent and the skew cancels. Every throughput number in pass G and in the committed baselines stands. Only backlog, which subtracts two different instruments at one nominal instant, is affected, and therefore only lag.py.

It is also worse than a constant offset: it scales with bucket size, so it grows within a round, which is precisely the signature lag.py reads as "unbounded backlog". A fail-closed instrument reaching a false SATURATED is the failure mode that matters here — it does not lie about a number, it suppresses one that exists.

Not this

connect-kafka also got a SATURATED verdict (+7,086 over 62 s = 114 rec/s, 0.95% of offered). Its count is kafka-get-offsets.sh, O(1) in topic size, so this skew does not explain it. Left open; it may be real Debezium flush behaviour at low offered rate.

connect-pg's NOT COMPARABLE (negative backlog, −425) is the separate known mismatch between the destination's net live rows and the source's n_tup_ins - n_tup_del.

Fix shape (not yet chosen)

Three candidates, in rough order of preference:

  1. Read src in the same hook as rows, before the expensive count. Move the TS_*/SRC_* psql read to the head of the destination-count hook. Needs care: TS_AFTER_MS is also the throughput window's end, and moving it earlier changes the window to exclude the count — which is arguably more correct, but it changes every rate in the harness and so cannot be done quietly. Emitting two timestamps (one for the window, one for the backlog pair) avoids that.
  2. Bracket the count and report its duration, then have lag.py subtract rate x duration from the after-backlog. Correct in expectation but it is a modelled correction on top of a measurement, which is the kind of thing this harness has been burned by.
  3. Count s3 rows from the object listing's metadata instead of downloading, so the count is O(objects) rather than O(bytes). Only helps s3, and the listing does not carry a row count.

Whichever is chosen, scripts/test-lag.py needs the case that would have caught this: a fixture where rows_after is sampled before src_after by a known interval at a known rate, asserting that the arm is not reported SATURATED.

Related

  • #3435 — the s3 count compared two snapshots of a growing bucket. Same class (a count whose relationship to time was not accounted for), different place.
  • #3434 — four remaining fail-open ground-truth counts.
  • PR #3440 — carries pass G and pass H, and states this artifact rather than fixing it.
Lingua principale
Go
Stelle
617
Fork
69
Merge medio
8h 5m
PR unite (30g)
122

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ConduitIO/conduit

Tutte le issue di ConduitIO/conduit

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.