sole add switch for scanwindow#5371
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (21)
📝 WalkthroughWalkthroughAdds an EnableScanWindow flag and wires it from config/proto through dispatcher initialization to event service logic and dynstream tuning, gating scan-window behaviors and updating tests. ChangesEnable Adaptive Scan Window Feature Flag
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces the enableScanWindow configuration option to conditionally gate the adaptive scan window feature (memory control and adaptive scan interval) for changefeeds, defaulting to false to preserve baseline behavior. This setting is propagated across the downstream adapter, event collector, protobuf definitions, replica configurations, and the event service. Feedback on the changes suggests correcting the struct tags for EnableScanWindow in ChangefeedConfig to ensure consistency with other configuration structs by adding the toml tag and using kebab-case for the json tag.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| EnableTableAcrossNodes bool `toml:"enable-table-across-nodes" json:"enable-table-across-nodes,omitempty"` | ||
| // EnableScanWindow controls whether the event service applies the adaptive scan | ||
| // window (memory control + adaptive scan interval) for this changefeed. | ||
| EnableScanWindow bool `json:"enable_scan_window" default:"false"` |
There was a problem hiding this comment.
The struct tag for EnableScanWindow in ChangefeedConfig is inconsistent with replicaConfig and other fields in ChangefeedConfig (such as EnableTableAcrossNodes). It is missing the toml tag entirely, and uses snake_case (enable_scan_window) instead of kebab-case (enable-scan-window) for the json tag.
Using kebab-case and adding the toml tag ensures consistency across configuration structs and prevents potential parsing/serialization issues.
| EnableScanWindow bool `json:"enable_scan_window" default:"false"` | |
| EnableScanWindow bool `toml:"enable-scan-window" json:"enable-scan-window,omitempty" default:"false"` |
Add a per-changefeed `enable-scan-window` replica config (default false) and plumb it through the changefeed config, dispatcher info and event service. When the switch is off the adaptive scan-window feature is fully inert and the changefeed behaves as if it was never introduced: - event service: memory control, adaptive scan interval, base-ts capping, empty-range signal, pending-DDL local advance and scan-window metrics are all gated. - dynstream: the memory release ratio follows the switch (0.4 off / 0.6 on); the deadlock high-water-mark stays 0.6 in both modes.
dbf6f1c to
4c438e2
Compare
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Contribute Code" section in the development guide. |
What problem does this PR solve?
Issue Number: close #xxx
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note
Summary by CodeRabbit
New Features
Performance
Tests