-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filter (ticdc): add dml expression filter #6215
filter (ticdc): add dml expression filter #6215
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
…dc into add_dml_expression_filter
pkg/filter/expr_filter.go
Outdated
} | ||
|
||
// shouldSkipDML skips dml event by sql expression. | ||
func (f *dmlExprFilter) shouldSkipDML(row *model.RowChangedEvent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a benchmark? Since it applies to all changes, it may become a bottleneck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd: go test -benchmem -run=^$ -bench ^BenchmarkSkipDML$ github.com/pingcap/tiflow/pkg/filter
goos: maxOS 12.3.1
goarch: arm64
cpu: Apple M1 Pro
BenchmarkSkipDML/insert-1-10 990166 1151 ns/op 768 B/op 24 allocs/op
BenchmarkSkipDML/insert-2-10 1000000 1187 ns/op 768 B/op 24 allocs/op
BenchmarkSkipDML/update-10 698208 1637 ns/op 1480 B/op 43 allocs/op
BenchmarkSkipDML/delete-10 1000000 1112 ns/op 768 B/op 24 allocs/op
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #6215 +/- ##
================================================
- Coverage 58.4193% 58.0700% -0.3493%
================================================
Files 711 714 +3
Lines 84205 83649 -556
================================================
- Hits 49192 48575 -617
- Misses 30540 30704 +164
+ Partials 4473 4370 -103 |
…dc into add_dml_expression_filter
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 71aeabf
|
/run-integration-tests |
/run-all-tests |
/run-kafka-tests |
/run-verify |
@asddongmen: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions 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 ti-community-infra/tichi repository. |
/run-verify |
/run-integration-tests |
What problem does this PR solve?
Issue Number: ref #6160
What is changed and how it works?
Add strcut
dmlExprFilter
topkg/filter
, it is a part of cdc row filter.Note: This PR will not change any behavior of cdc, it only:
dmlExprFilter
.EventFilterRule
topkg/config/filter.go
.RowChangedDatums
tomodel.RowChangedEvent
to facilitatedmlExprFilter
's function.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