8000 fix(offsets): pace the hard-cap log lines -- one WARN per pacing period, silent pauses inside a 60 s re-arm window, one summary per minute (Spec 01.05 section 3.4 item 6) by minguyen9988 · Pull Request #1504 · Altinity/clickhouse-sink-connector · GitHub
[go: up one dir, main page]

Skip to content

fix(offsets): pace the hard-cap log lines -- one WARN per pacing period, silent pauses inside a 60 s re-arm window, one summary per minute (Spec 01.05 section 3.4 item 6) - #1504

Merged
minguyen9988 merged 2 commits into
2.11.0from
fix-handoff-cap-log-pacing
Sep 26, 2026
Merged

minguyen9988 merged 2 commits into
2.11.0from
fix-handoff-cap-log-pacing

Conversation

@minguyen9988
Copy link
Copy Markdown
Collaborator

Defect

The hard cap on rows handed off and not yet acknowledged (#1503) holds the reader until the writers acknowledge the head of the FIFO, and one acknowledgement is exactly one unit: the reader is released, hands off the next unit, meets the cap again. At the cap it oscillates one batch at a time by construction, so the rule 'one WARN when a wait begins, one INFO when it ends' became one WARN/INFO pair per batch. Measured on the first deployment that met the cap: about 300 Handoff hard cap lines a minute and 990 WARNs into the error log in seven minutes, while the cap was doing exactly its job and nothing was wrong.

Rule (spec 01.05 section 3.4 item 6)

A pacing period. ONE WARN when a wait begins more than 60 s after the previous release (or with no previous release), naming rows, units and cap, and ONE INFO when that first wait ends. Every later wait that begins within 60 s of the previous release continues the period and is counted, not logged. ONE INFO summary per 60 s while the period lasts: pauses and milliseconds paused since the previous line and since the period began, rows and units outstanding. ONE INFO 'pacing ended' when the next wait begins after a quiet gap longer than 60 s, or on reset(). Nothing per slice, nothing when the cap is not met. The waits themselves, the dead-worker check between slices and the wait limit are unchanged: pacing changes what is logged, never how long the reader waits.

Change

  • DebeziumOffsetManagement: beginPause / endPause / closePacingPeriod around the existing wait loop; bookkeeping under the class monitor; reset() closes the period; a package-private nanosecond clock (capacityClock) so tests cross the windows without sleeping while the waits and the limit stay on System.nanoTime().
  • New HandoffHardCapLogPacingTest (4 tests): silent pauses inside the re-arm window; one summary per interval naming the pauses since the previous line and since the period began; pacing ended after a quiet gap; reset() closes the period and the next pause opens a new one.
  • Specs: 01.05 section 3.4 item 6 rewritten with the measured numbers; verification citations in 01.05 section 5 and 09.01 section 5.

Checks on this branch

  • validate_specs: PASSED (63 specifications, 644 citations).
  • sink-connector: HandoffHardCapLogPacingTest 4/4, HandoffHardCapBackpressureTest 7/7 (unchanged), HandoffBacklogAdvisoryTest 4/4, DebeziumOffsetManagementTest 4/4, RetiredHandoffNotAcknowledgedTest 4/4, OffsetNoLossParameterIndependenceTest 5/5 -- 28/28, BUILD SUCCESS.
  • sink-connector-lightweight: StoppedEngineRetiresHandoffsTest 3/3, DeadWorkerRetryIsTerminalTest 3/3, EngineRestartFifoResetTest 6/6 -- BUILD SUCCESS.

…cillates one unit at a time, so one WARN/INFO per wait was one per batch (~300 lines a minute, 990 WARNs into the error log in seven minutes on the first deployment that met the cap); now one WARN per pacing period, pauses inside a 60 s re-arm window counted not logged, one summary INFO per minute while paced, one 'pacing ended' line after a quiet gap or on reset() (Spec 01.05 section 3.4 item 6)
…lands 52 s into the period -- at 61 s the per-minute summary fires by design, which the test had mistaken for a stray line
@minguyen9988
minguyen9988 merged commit 5120dc5 into 2.11.0 Sep 26, 2026
11 checks passed
@minguyen9988
minguyen9988 deleted the fix-handoff-cap-log-pacing branch September 26, 2026 06:20
minguyen9988 added a commit that referenced this pull request Sep 26, 2026
… one squashed commit with the same content as the two pacing commits this branch was stacked on; the three conflicts (DebeziumOffsetManagement.java, spec 01.05, spec 09.01) resolve to this branch's versions, which carry the pacing text plus the byte-bound additions
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.

1 participant

0