eventservice: keep transaction cursor inside scan window - #6040
eventservice: keep transaction cursor inside scan window#6040asddongmen wants to merge 1 commit into
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 |
|
/run-check-issue-triage-complete |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe event broker now preserves transaction-start and row-position cursors when adaptive window capping shrinks a scan range. The regression test verifies a scan request with matching commit timestamps and the original transaction cursor. ChangesScan-range resume handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized fix keeps transaction resume cursors within the scan window to prevent a narrow dispatcher stall; no actionable merge-blocking risk remains after normal checks and review. Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Command failed 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 |
|
/test all |
What problem does this PR solve?
Issue Number: ref #6022
An interrupted EventService scan can publish a transaction cursor
(commitTs=C, startTs=S). If the adaptive scan window later shrinks belowC, the existing code skips the now-empty range even though a nonzeroTxnStartTsalso prevents signal resolved-ts, so the dispatcher must wait for the window to reachCagain.This is a narrow liveness corner case. It is not intended to attribute the previously observed low-CPU periodic throughput issue to this path.
What is changed and how it works?
Treat either a row position or transaction start-ts as a resume cursor. When scan-window capping moves the end below the cursor commit-ts, normalize the effective range to
[C,C].For
TxnStartTs=S, EventStore scans from(C,S+1)to the end of commit-tsC, so only later transactions sharingCare resumed. Ordinary empty ranges without a cursor, DDL/syncpoint handling, and large-transaction behavior are unchanged.A focused unit test covers the transaction-cursor case after the scan window shrinks behind
C.Check List
Tests
Questions
Will it cause performance regression or break compatibility?
No compatibility change. An extra scan is possible only for a valid resume cursor that the old path skipped; the scan is required to make progress.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note
Summary by CodeRabbit