-
Notifications
You must be signed in to change notification settings - Fork 288
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
kv/client: use ephemeral goroutine to handle region range request #1720
kv/client: use ephemeral goroutine to handle region range request #1720
Conversation
/run-all-tests |
/run-integration-tests |
Codecov Report
@@ Coverage Diff @@
## master #1720 +/- ##
================================================
+ Coverage 52.8727% 53.0369% +0.1642%
================================================
Files 153 153
Lines 15891 15904 +13
================================================
+ Hits 8402 8435 +33
+ Misses 6584 6563 -21
- Partials 905 906 +1 |
85812ff
to
3129458
Compare
/run-all-tests |
/run-unit-tests |
/run-all-tests |
1 similar comment
/run-all-tests |
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.
/lgtm
ptal @liuzix |
[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 writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: cd5b837
|
/lgtm, though i am not in the list |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 6d320fe
|
/run-unit-tests |
/run-integration-tests |
3 similar comments
/run-integration-tests |
/run-integration-tests |
/run-integration-tests |
In response to a cherrypick label: new pull request created: #1800. |
In response to a cherrypick label: new pull request created: #1801. |
What problem does this PR solve?
Fix part bug found in #1599
https://github.com/pingcap/ticdc/blob/109257825f7805bfc0f87b68d9ef7e969aa19161/cdc/kv/client.go#L578-L591
divideAndSendEventFeedToRegions
function scans range into several regions, and dispatch each region viascheduleRegionRequest
. There could be stale regions, and these stale regions will be resent tos.requestRangeCh
in L646. If thes.requestRangeCh
is full, deadlock happens.https://github.com/pingcap/ticdc/blob/109257825f7805bfc0f87b68d9ef7e969aa19161/cdc/kv/client.go#L627-L648
https://github.com/pingcap/ticdc/blob/109257825f7805bfc0f87b68d9ef7e969aa19161/cdc/kv/client.go#L616-L623
What is changed and how it works?
In order to consume region range request from
requestRangeCh
as soon as possible, we create a new goroutine to handle it. The sequence of region range we process is not matter, the region lock keeps the region access sequence. Besides the count or frequency of range request is limitted, we use ephemeral goroutine instead of permanent gourotine.Check List
Tests
Release note