-
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
kv-client: add stream binding background region worker, not enabled by default #1397
kv-client: add stream binding background region worker, not enabled by default #1397
Conversation
/run-all-tests |
19f00ff
to
ab83d81
Compare
Codecov Report
@@ Coverage Diff @@
## master #1397 +/- ##
================================================
- Coverage 48.6903% 47.5895% -1.1009%
================================================
Files 138 140 +2
Lines 13668 14043 +375
================================================
+ Hits 6655 6683 +28
- Misses 6317 6662 +345
- Partials 696 698 +2 |
bb6aeb8
to
9d7ce1c
Compare
/run-all-tests |
/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.
Rest LGTM
@@ -375,13 +375,14 @@ func (w *regionWorker) evictAllRegions(ctx context.Context) error { | |||
w.statesLock.Lock() | |||
defer w.statesLock.Unlock() | |||
for _, state := range w.regionStates { | |||
log.Info("on region fail fired", zap.Reflect("state", state)) | |||
state.lock.RLock() |
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.
I prefer the following, in case onRegionFail
blocks.
state.lock.RLock()
singleRegionInfo := state.sri
state.lock.RUnlock()
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.
onRegionFail
is non-blocking way
Besides, this code will be rewritten in later PR
LGTM |
/merge |
/run-all-tests |
@amyangfei merge failed. |
/merge |
/run-all-tests |
/run-integration-tests |
@amyangfei merge failed. |
|
/merge |
/run-all-tests |
/run-cherry-picker |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #1455 |
What problem does this PR solve?
Preparatory work for #1393
What is changed and how it works?
Add a new configuration item in changefeed config,Use a hard code const variablekv-client-v2
, default false now, which will help us test the new feature. After refactor is stable, this config can be removed. (NOTE: add or remove a new item in changefeed config is both forward compatible and backward compatible)kvClientV2
, which is simplercdc/kv/client.go
cdc/kv/region_worker.go
, the region worker is single goroutine now, and has a state lock for all regions that it manages. One gRPC stream <-> One region worker (multiple routines support in another pr) <-> One resolve lock routineNOTE:
Check List
Tests
Release note