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

*: follower support to handle GetRegion and other region api #7432

Merged
merged 27 commits into from
Dec 29, 2023

Conversation

CabinfeverB
Copy link
Member

@CabinfeverB CabinfeverB commented Nov 24, 2023

What problem does this PR solve?

Issue Number: ref #7431
should be merged after #7489 #7611

What is changed and how does it work?

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)
    image

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

PD allows followers to handle gRPC API about region info such as `GetRegion` and `ScanRegions`. It can increase the maximum carrying capability of the PD routing service.

Copy link
Contributor

ti-chi-bot bot commented Nov 24, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch
  • rleungx

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.

Copy link
Contributor

ti-chi-bot bot commented Nov 24, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. labels Nov 24, 2023
@ti-chi-bot ti-chi-bot bot requested review from disksing and rleungx November 24, 2023 01:36
@ti-chi-bot ti-chi-bot bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 24, 2023
@CabinfeverB CabinfeverB marked this pull request as ready for review November 24, 2023 07:16
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 24, 2023
@CabinfeverB CabinfeverB changed the title add follower handle *: support follower handle Nov 24, 2023
@CabinfeverB CabinfeverB changed the title *: support follower handle *: follower support handle GetRegion and other region api Nov 24, 2023
@CabinfeverB CabinfeverB changed the title *: follower support handle GetRegion and other region api *: follower support to handle GetRegion and other region api Nov 24, 2023
@CabinfeverB CabinfeverB requested review from nolouch and removed request for disksing November 24, 2023 07:18
@CabinfeverB
Copy link
Member Author

cc @niubell

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #7432 (c742353) into master (cf22c04) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 46.32%.

❗ Current head c742353 differs from pull request most recent head ff657fd. Consider uploading reports for the commit ff657fd to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7432      +/-   ##
==========================================
+ Coverage   74.79%   74.80%   +0.01%     
==========================================
  Files         459      459              
  Lines       50978    51062      +84     
==========================================
+ Hits        38128    38196      +68     
- Misses       9489     9493       +4     
- Partials     3361     3373      +12     
Flag Coverage Δ
unittests 74.80% <46.32%> (+0.01%) ⬆️

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

Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@CabinfeverB CabinfeverB marked this pull request as draft December 4, 2023 03:28
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 4, 2023
@CabinfeverB CabinfeverB force-pushed the follower/refactor_forward branch from c074c18 to 739deba Compare December 5, 2023 09:37
Signed-off-by: Cabinfever_B <[email protected]>
Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 26, 2023
Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 27, 2023
func (s *GrpcServer) validateRequest(header *pdpb.RequestHeader) error {
if s.IsClosed() || !s.member.IsLeader() {
return ErrNotLeader
return s.validateRoleInRequest(context.TODO(), header, nil)
Copy link
Member

Choose a reason for hiding this comment

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

Why not just name it as validateRequest?

Copy link
Member Author

@CabinfeverB CabinfeverB Dec 28, 2023

Choose a reason for hiding this comment

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

Some code needs the original validateRequest which only has one param and is easy to use, so I keep it.

var region *core.RegionInfo
if *followerHandle {
rc = s.cluster
if !s.cluster.GetRegionSyncer().IsRunning() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if !s.cluster.GetRegionSyncer().IsRunning() {
if !rc.GetRegionSyncer().IsRunning() {

@CabinfeverB CabinfeverB mentioned this pull request Dec 28, 2023
3 tasks
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 28, 2023
@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 29, 2023
@nolouch
Copy link
Contributor

nolouch commented Dec 29, 2023

/merge

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

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

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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.

Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

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

Commit hash: c742353

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 29, 2023
Copy link
Contributor

ti-chi-bot bot commented Dec 29, 2023

@CabinfeverB: Your PR was out of date, I have automatically updated it for you.

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.

@ti-chi-bot ti-chi-bot bot merged commit a67ccbb into tikv:master Dec 29, 2023
22 checks passed
pingandb pushed a commit to pingandb/pd that referenced this pull request Jan 18, 2024
…7432)

ref tikv#7431

Signed-off-by: Cabinfever_B <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: pingandb <[email protected]>
@lidaohang
Copy link

mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. 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.

4 participants