8000 fix(logging): the resume replay is summarized, never dumped -- operation types and counts instead of one full row image per skipped event (Spec 01.07 section 3.5) by minguyen9988 · Pull Request #1509 · Altinity/clickhouse-sink-connector · GitHub
[go: up one dir, main page]

Skip to content

fix(logging): the resume replay is summarized, never dumped -- operation types and counts instead of one full row image per skipped event (Spec 01.07 section 3.5) - #1509

Merged
minguyen9988 merged 2 commits into
2.11.0from
fix-resume-replay-log-summary
Sep 26, 2026
Merged

minguyen9988 merged 2 commits into
2.11.0from
fix-resume-replay-log-summary

Conversation

@minguyen9988
Copy link
Copy Markdown
Collaborator

Noise

Every engine start resumes from the durable offset, which Debezium records as the transaction's BEGIN plus the number of events already delivered. The binlog client re-reads the transaction from BEGIN and Debezium skips the events it has already delivered -- logging EACH one at INFO from io.debezium.connector.binlog.BinlogStreamingChangeEventSource as 'Skipping previously processed row event: Event{header=..., data=...{rows=[ ... ]}}', i.e. the complete row image, some seventy lines per event. On one deployment a single start logged 5,227 such events: seven rotated 6 MB files in fourteen seconds, all of it row data, none of it an error. The operator's rule: do not print the row data; print the operation type and the count of that operation.

Rule (spec 01.07 section 3.5)

ResumeReplayLogSummary is a log4j filter the connector installs programmatically at setup() on that Debezium logger (idempotent per process; no deployment log4j2.xml change):

  • a line from that logger beginning 'Skipping previously processed ' is DENIED (never written anywhere) and counted under the row operation its binlog event type carries: WRITE_ROWS/EXT_WRITE_ROWS -> INSERT, UPDATE_ROWS/EXT_UPDATE_ROWS -> UPDATE, DELETE_ROWS/EXT_DELETE_ROWS -> DELETE, any other type under its own name; the first and last nextPosition are kept;
  • the replay ends when the next line from that logger is not a skip (the reader moved past the resume point): ONE INFO line reports the total, elapsed time, position range and the counts per operation, then the counters reset; an engine stop flushes a replay still being counted (stop() step 4c);
  • a replay still running after 60 s logs one progress line per 60 s, same shape, never one per event;
  • every other line from that logger passes unchanged; other loggers are never inspected.

Example of the replacement line: 'Resume replay done (the reader moved past the resume point): skipped 5227 previously processed binlog event(s) already applied before this start, 14 s, binlog positions 1457290340..1502834139 -- INSERT=5227. Only the operation types and counts are logged, never the row images.'

Checks on this branch

  • validate_specs: PASSED (63 specifications, 645 citations).
  • sink-connector-lightweight: 24/24 -- new ResumeReplayLogSummaryTest 5/5 (skip lines denied and counted, one summary on the next non-skip line with no row image; other loggers untouched; progress line per interval and flush on stop; install() idempotent and effective on Debezium's real logger; event-type to operation mapping); BinlogKeepAlivePreflightTest 7/7, StoppedEngineRetiresHandoffsTest 3/3, DeadWorkerRetryIsTerminalTest 3/3, EngineRestartFifoResetTest 6/6. BUILD SUCCESS.

…um's per-event 'Skipping previously processed ... event' lines (each a full row image; 5,227 of them, seven rotated 6 MB files in fourteen seconds, at one start) are denied by a log4j filter installed at setup() and reported as one line per resume with the operation types and their counts (Spec 01.07 section 3.5)
…onflict was the setup() preflight block, where #1505 added DebeziumQueueBytesPreflight next to the ResumeReplayLogSummary install; both are kept, queue preflight first
@minguyen9988
Copy link
Copy Markdown
Collaborator Author

Conflict resolved by merging the current 2.11.0 head ( 8000 474c821, which now carries #1505, #1506 and #1507) into this branch as a merge commit (8230bb0, fast-forward push, no rebase). The only conflict was the setup() preflight block, where #1505 added DebeziumQueueBytesPreflight.apply(props) at the same spot as this branch's ResumeReplayLogSummary.install(); both are kept, queue preflight first. stop() carries both step 4a (close worker connections, from #1506) and step 4c (flush a replay still being counted, from this branch). The diff against 2.11.0 is now exactly this change (4 files, +464). Re-checked on the merge result: validate_specs PASSED (63 specs); sink-connector-lightweight 28/28 -- ResumeReplayLogSummaryTest 5/5, BinlogKeepAlivePreflightTest 7/7, DebeziumQueueBytesPreflightTest 4/4, StoppedEngineRetiresHandoffsTest 3/3, DeadWorkerRetryIsTerminalTest 3/3, EngineRestartFifoResetTest 6/6; BUILD SUCCESS.

@minguyen9988
minguyen9988 merged commit 821644c into 2.11.0 Sep 26, 2026
2 checks passed
@minguyen9988
minguyen9988 deleted the fix-resume-replay-log-summary branch September 26, 2026 08:38
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

342C
0