fix(#805): reduce DEBUG log noise from binlog reader#806
Merged
Conversation
Trim two large sources of noise that dominate CI DEBUG logs without
adding diagnostic value, and add per-phase summary logs around the
watermark optimization so the remaining per-row Debug lines become
grep-skippable rather than essential.
- pkg/repl/client.go: list the five known stream-housekeeping events
(GTID, TableMap, XID, FormatDescription, PreviousGTIDs) explicitly
in the type switch so they fall through silently. Default case still
logs so an unrecognized future row-event variant is not silently
dropped. Also drop the per-rotate Debug log.
- pkg/repl/subscription_{map,buffered,queue}.go: add atomic counters
(keysAdded, keysDroppedAbove, keysSkippedBelow) and emit a single
Info-level "watermark optimization toggled" log on each transition
with the per-phase totals plus delta_len. Counters reset on toggle.
Per-row Debug logs are kept for zoomed-in debugging.
- pkg/repl/subscription_{map,buffered}_test.go: tighten three existing
tests to assert the path taken via the new counters in addition to
the post-state.
aparajon
approved these changes
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Trims two large sources of noise from CI DEBUG logs (the bulk of the volume in #805) and replaces aggregate signal lost from the trimming with a single bookend log per watermark-optimization phase.
pkg/repl/client.go— enumerate the five binlog stream-housekeeping events (GTIDEvent,TableMapEvent,XIDEvent,FormatDescriptionEvent,PreviousGTIDsEvent) as explicit empty cases in the type switch. They fall through silently rather than tripping the "Received unknown event type" log (~68k lines on the sample run). Thedefaultcase still logs, so a future row-event variant we don't recognize will not be silently dropped.pkg/repl/client.go— drop the per-rotate Debug log (~4.5k lines on the sample run). The rotate handler logic is unchanged.pkg/repl/subscription_{map,buffered,queue}.go— add atomic counters (keysAdded,keysDroppedAbove,keysSkippedBelow) and emit a singleInfo-level\"watermark optimization toggled\"log on eachSetWatermarkOptimizationcall withtable,enabled, all three counters, and currentdelta_len. Counters are swapped to zero on the toggle so each phase reports its own totals. The existing per-row Debug logs are kept for zoom-in debugging — the bookend log is what makes them grep-skippable rather than essential.pkg/repl/subscription_{map,buffered}_test.go— three existing tests now assert the path taken via the new counters in addition to the post-state:TestKeyAboveWatermarkTestFlushUnderLockBypassesWatermarkTestBufferedMapFlushWithoutLockRespectsWatermarkCloses #805. Companion to the diagnostic logging in #750 for #746 — makes those logs much easier to read on the next CI hit.
Test plan
go build ./...cleango vet ./...cleango test ./pkg/repl/ -count=1green locally against MySQL 8.0🤖 Generated with Claude Code