feat(router service): support to sync region from pd leader #9845
feat(router service): support to sync region from pd leader #9845ti-chi-bot[bot] merged 7 commits intotikv:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9845 +/- ##
==========================================
- Coverage 78.70% 78.52% -0.18%
==========================================
Files 492 503 +11
Lines 66268 67131 +863
==========================================
+ Hits 52153 52717 +564
- Misses 10408 10592 +184
- Partials 3707 3822 +115
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: 童剑 <1045931706@qq.com>
23817f0 to
c737484
Compare
cefb214 to
8e04378
Compare
Signed-off-by: 童剑 <1045931706@qq.com>
| @@ -138,6 +138,7 @@ func (s *RegionSyncer) RunServer(ctx context.Context, regionNotifier <-chan *cor | |||
| select { | |||
| case <-ctx.Done(): | |||
| log.Info("region syncer has been stopped") | |||
| s.closeAllClient() | |||
There was a problem hiding this comment.
no, the follower will recampaign and close the client stream also in most cases.
| } | ||
| log.Info("server starts to synchronize with leader", zap.String("server", s.name), zap.String("leader", leaderAddr), zap.Uint64("request-index", s.nextSyncIndex)) | ||
| for { | ||
| resp, err := stream.Recv() |
There was a problem hiding this comment.
Do we need to check the io.EOF?
There was a problem hiding this comment.
yes, I think we should handle this error
pkg/mcs/router/server/server.go
Outdated
| s.CloseClientConns() | ||
| s.serverLoopCancel() | ||
| if s.serverLoopCancel != nil { |
Signed-off-by: 童剑 <1045931706@qq.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: okJiang, rleungx 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 |
|
CI failed |
|
/test pull-unit-test-next-gen |
1 similar comment
|
/test pull-unit-test-next-gen |
|
/retest |
1 similar comment
|
/retest |
|
/test pull-unit-test-next-gen |
What problem does this PR solve?
Issue Number: ref #9212
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn:pingcap/tiup:Release note