Skip to content

fix(precompute): keep wall-clock fallback from force-closing panes still under active ingest - #536

Merged
milindsrivastava1997 merged 4 commits into
mainfrom
474-fixprecompute-bulk-single-timestamp-ingest-silently-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1
Aug 18, 2026
Merged

fix(precompute): keep wall-clock fallback from force-closing panes still under active ingest#536
milindsrivastava1997 merged 4 commits into
mainfrom
474-fixprecompute-bulk-single-timestamp-ingest-silently-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The wall-clock fallback in flush_all() aged a pane by time-since-first-touch, never refreshed. A bulk load whose rows all share one event-time (so the watermark never advances) that takes longer than window_size_ms + wall_clock_grace_period_ms to ingest got its window force-closed mid-ingest, silently dropping every row that arrived afterward (uniform undercount across every group key). Fixes fix(precompute): bulk single-timestamp ingest silently drops rows when wall-clock fallback closes the window mid-ingest #474.
  • Refreshes the pane's wall-clock bookkeeping on every touch instead of only the first, so the fallback measures idle time, not time elapsed since the window started. Thus, a pane that is still receiving samples is never force-closed no matter how long it's been open. Only a pane that does not receive any data for a while is force closed.
  • Renamed pane_wall_clock_starts_mspane_wall_clock_last_touch_ms (+ its prune helper) to match the corrected semantics, and updated the doc comments that described the old birth-time behavior.

First of a 3-PR stack; this one is the minimal, self-contained bug fix and can ship on its own. #2 and #3 add e2e test infrastructure on top.

…ill under active ingest

The wall-clock fallback in flush_all() ages a pane using the wall-clock time
it was first touched, never refreshed. A bulk load whose rows all share one
event-time (so the event-time watermark never advances) that takes longer
than window_size_ms + wall_clock_grace_period_ms to ingest therefore gets
its window force-closed mid-ingest, and every sample arriving afterward is
silently dropped by the (hardcoded) late-data path — a uniform undercount
across every group key (#474).

Refresh the pane's wall-clock bookkeeping on every touch instead of only the
first, so the fallback measures idle time, not age since birth: a pane still
receiving samples is never force-closed no matter how long it's been open,
only a pane nothing has touched in a while is. Renamed
pane_wall_clock_starts_ms -> pane_wall_clock_last_touch_ms (and its prune
helper) to match, and updated the doc comments describing the old
birth-time semantics.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…k-single-timestamp-ingest-silently-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1
…k-single-timestamp-ingest-silently-drops-rows-when-wall-clock-fallback-closes-the-window-mid-ingest-1
zzylol
zzylol previously approved these changes Aug 18, 2026
…ill-active-pane test

wall_clock_fallback_does_not_close_a_pane_still_receiving_samples ran all 8
touches before either flush_all() call, so the "mid-ingest" check never
actually sat between two touches in wall-clock terms. Restructured to do 7
touches, the mid-ingest flush check, then the 8th touch, then the final
flush -- so the check genuinely exercises "still receiving samples" instead
of comparing against an already-completed touch. Also documents why no
absolute wall-clock ceiling is enforced on a pane's lifetime (deferred by
design, not an oversight).

Interleaving the flush for real exposed a second, unrelated bug in the test
helper: every flush_all() call unconditionally nudges the event-time
watermark forward by 1ms (the "boundary advance" that lets an idle stream
make progress), independent of the wall-clock fallback. With
allowed_lateness_ms=0, that 1ms of drift alone marked the 8th touch "late"
and dropped it via a wholly different code path. Set to 1 -- the exact
amount one intervening flush contributes, not an arbitrary buffer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 merged commit 9a018cb into main Aug 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(precompute): bulk single-timestamp ingest silently drops rows when wall-clock fallback closes the window mid-ingest

2 participants