Skip to content
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

server: use old interface for scatter region #4766

Merged
merged 5 commits into from
Mar 28, 2022

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Mar 24, 2022

Signed-off-by: nolouch nolouch@gmail.com

What problem does this PR solve?

Issue Number: Close #4763

What is changed and how it works?

server: use old interface for scatter region

Check List

Tests

Release note

None

Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 24, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • lhy1024

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 24, 2022
@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #4766 (84bf9b6) into master (7baf94c) will increase coverage by 0.06%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #4766      +/-   ##
==========================================
+ Coverage   75.09%   75.16%   +0.06%     
==========================================
  Files         294      294              
  Lines       28325    28325              
==========================================
+ Hits        21271    21290      +19     
+ Misses       5174     5151      -23     
- Partials     1880     1884       +4     
Flag Coverage Δ
unittests 75.16% <50.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/grpc_service.go 52.50% <50.00%> (+0.37%) ⬆️
server/tso/local_allocator.go 64.86% <0.00%> (-13.52%) ⬇️
server/election/leadership.go 75.25% <0.00%> (-2.07%) ⬇️
server/tso/allocator_manager.go 63.27% <0.00%> (-1.43%) ⬇️
server/tso/global_allocator.go 60.84% <0.00%> (-1.06%) ⬇️
server/schedule/operator/step.go 74.07% <0.00%> (-1.02%) ⬇️
client/base_client.go 79.89% <0.00%> (-0.52%) ⬇️
server/encryptionkm/key_manager.go 73.70% <0.00%> (+0.39%) ⬆️
server/server.go 75.31% <0.00%> (+1.25%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7baf94c...84bf9b6. Read the comment docs.

@@ -1204,7 +1204,7 @@ func (s *GrpcServer) ScatterRegion(ctx context.Context, request *pdpb.ScatterReg
}, nil
}

region := rc.GetRegion(request.GetRegion().GetId())
region := rc.GetRegion(request.GetRegionId())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should support both fields and completely remove the deprecated one in a future release.

Copy link
Contributor Author

@nolouch nolouch Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new field is RegionsId, then regionID deprecated in pingcap/kvproto#686. Both regionID and regionsID are supported. here is incorrectly use Region field.

Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch nolouch added the needs-cherry-pick-release-6.0 The PR needs to cherry pick to release-6.0 branch. label Mar 28, 2022
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 28, 2022
@nolouch nolouch changed the title [DNM] server: use old interface for scatter region server: use old interface for scatter region Mar 28, 2022
Signed-off-by: nolouch <nolouch@gmail.com>
region := rc.GetRegion(request.GetRegion().GetId())
// TODO: Deprecate it use `request.GetRegionsID`.
//nolint
region := rc.GetRegion(request.GetRegionId())
if region == nil {
if request.GetRegion() == nil {
return nil, errors.Errorf("region %d not found", request.GetRegion().GetId())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot ti-chi-bot added status/LGT1 Indicates that a PR has LGTM 1. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 28, 2022
@nolouch
Copy link
Contributor Author

nolouch commented Mar 28, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 84bf9b6

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 28, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4767.

@nolouch nolouch deleted the revert-interface branch March 28, 2022 10:33
ti-chi-bot added a commit that referenced this pull request Mar 28, 2022
close #4763, ref #4766

server: use old interface for scatter region

Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: nolouch <nolouch@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.0 The PR needs to cherry pick to release-6.0 branch. release-note-none Denotes a PR that doesn't merit a release note. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scatter region failed due to region 0 not found during lightning import
5 participants