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

mcs: close the connection to avoid retrying to connect #7757

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Jan 25, 2024

What problem does this PR solve?

Issue Number: Ref #5839.

What is changed and how does it work?

Check List

Tests

  • Manual test

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Jan 25, 2024

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • 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 bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jan 25, 2024
@ti-chi-bot ti-chi-bot bot requested review from disksing and lhy1024 January 25, 2024 07:37
@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 25, 2024
@rleungx rleungx requested review from JmPotato and CabinfeverB and removed request for disksing January 25, 2024 07:46
@@ -1332,6 +1331,8 @@ func (s *GrpcServer) RegionHeartbeat(stream pdpb.PD_RegionHeartbeatServer) error
if cancel != nil {
cancel()
}

Copy link
Contributor

Choose a reason for hiding this comment

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

if only switch primary, do we need to close it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Both are ok to me.

}
} else if fh := grpcutil.GetForwardedHost(streamCtx); !s.isLocalRequest(fh) {
forwardedHost = fh
func (s *GrpcServer) closeDelegateClient(forwardedHost string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add some log?

@lhy1024
Copy link
Contributor

lhy1024 commented Jan 25, 2024

image
It works too.

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Merging #7757 (03f0fcd) into master (357ad3f) will decrease coverage by 3.47%.
Report is 1 commits behind head on master.
The diff coverage is 68.18%.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7757      +/-   ##
==========================================
- Coverage   73.52%   70.06%   -3.47%     
==========================================
  Files         430      430              
  Lines       47745    47643     -102     
==========================================
- Hits        35106    33380    -1726     
- Misses       9627    11518    +1891     
+ Partials     3012     2745     -267     
Flag Coverage Δ
unittests 70.06% <68.18%> (-3.47%) ⬇️

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

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 29, 2024
@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 Jan 31, 2024
pkg/utils/grpcutil/grpcutil.go Outdated Show resolved Hide resolved
server/forward.go Outdated Show resolved Hide resolved
@rleungx rleungx requested a review from JmPotato January 31, 2024 07:03
@JmPotato
Copy link
Member

/merge

Copy link
Contributor

ti-chi-bot bot commented Jan 31, 2024

@JmPotato: 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 Jan 31, 2024

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

Commit hash: 313ec06

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 31, 2024
@rleungx
Copy link
Member Author

rleungx commented Jan 31, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented Jan 31, 2024

@rleungx: 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 Jan 31, 2024

@rleungx: 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.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot ti-chi-bot bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jan 31, 2024
@rleungx
Copy link
Member Author

rleungx commented Jan 31, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented Jan 31, 2024

@rleungx: 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 Jan 31, 2024

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

Commit hash: ad701a9

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 31, 2024
@ti-chi-bot ti-chi-bot bot merged commit 9721654 into tikv:master Jan 31, 2024
22 checks passed
@rleungx rleungx deleted the close-conn branch January 31, 2024 10:00
rleungx added a commit to rleungx/pd that referenced this pull request Feb 26, 2024
* mcs: close the connection to avoid retrying to connect (tikv#7757)

ref tikv#5839

Signed-off-by: Ryan Leung <rleungx@gmail.com>

* mcs: add store and region interface in scheduling server (tikv#7754)

ref tikv#5839

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: lhy1024 <admin@liudos.us>

* remove test

Signed-off-by: lhy1024 <admin@liudos.us>

* fix test

Signed-off-by: lhy1024 <admin@liudos.us>

---------

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: lhy1024 <admin@liudos.us>
Co-authored-by: Ryan Leung <rleungx@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 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