eventService: Optimize DML processing performance II #5474
Conversation
|
Skipping CI for Draft Pull Request. |
|
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 selected for processing (5)
📝 WalkthroughWalkthroughAdds ChangesDML Event-Type Filter Fast Path
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 a fast-path optimization in the event scanner's DML processor to check if DML events (specifically Insert and Delete) can be ignored based on their event type before performing expensive row decoding. It caches these pre-decode filter results within each transaction and adds corresponding benchmarks and unit tests. The feedback suggests addressing the magic number 3 used for the cache array size by defining a named constant or adding explanatory comments, and explores extending this fast-path optimization to the Update path (both split and non-split updates) to further enhance performance under update-heavy workloads.
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.
|
/test all |
|
/retest |
|
@asddongmen: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| ShouldIgnoreDML(dmlType common.RowType, preRow, row chunk.Row, tableInfo *common.TableInfo, startTs uint64, ctx DMLFilterContext) (bool, error) | ||
| // ShouldIgnoreDMLByEventType returns true only when filters that do not need | ||
| // decoded row values can determine the DML should be ignored. | ||
| ShouldIgnoreDMLByEventType(dmlType common.RowType, tableInfo *common.TableInfo, startTs uint64) (bool, error) |
There was a problem hiding this comment.
Maybe ShouldIgnoreDMLBeforeDecode is a better name?
There was a problem hiding this comment.
I prefer current name because I think filter shouldn't care if an event is decoded or not.
lidezhu
left a comment
There was a problem hiding this comment.
LGTM with minor comments
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lidezhu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: ref #5430
Delete-heavy changefeeds that configure
ignore-event = ["delete"]still decodedignored delete rows and appended them into
DMLEventbefore filtering, addingunnecessary eventService scanner CPU during historical catch-up.
What is changed and how it works?
eventScanner now checks type-only DML filters before row decode for insert/delete
events and caches the result within each transaction. Ignored deletes bypass
DecodeToChunkandDMLEvent.AppendRow. Non-ignored deletes still use thenormal decode, append, and send path.
Check List
Tests
338.3s229.0s32.3%faster 🔼410.3s400.7sQuestions
Will it cause performance regression or break compatibility?
No compatibility break expected. No-ignore delete keeps the normal path.
Do you need to update user documentation, design documentation or monitoring documentation?
No. This is an internal eventService optimization.
Release note
Summary by CodeRabbit
New Features
Tests