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: advance ServerStart check #8951

Merged
merged 8 commits into from
Jan 2, 2025
Merged

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Dec 26, 2024

What problem does this PR solve?

Issue Number: Close #8950

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Release note

Fix the problem that PD may panic after enable `tidb_enable_tso_follower_proxy`.

Signed-off-by: okJiang <[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. do-not-merge/needs-triage-completed dco-signoff: yes Indicates the PR's author has signed the dco. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 26, 2024
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

Attention: Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.33%. Comparing base (0bfa31f) to head (6186e8c).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8951      +/-   ##
==========================================
- Coverage   76.34%   76.33%   -0.02%     
==========================================
  Files         465      465              
  Lines       70537    70547      +10     
==========================================
- Hits        53853    53850       -3     
- Misses      13344    13356      +12     
- Partials     3340     3341       +1     
Flag Coverage Δ
unittests 76.33% <53.84%> (-0.02%) ⬇️

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

Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/needs-triage-completed labels Dec 26, 2024
@okJiang
Copy link
Member Author

okJiang commented Dec 27, 2024

/cc @rleungx @JmPotato @bufferflies

@@ -710,6 +714,9 @@ func (s *GrpcServer) IsSnapshotRecovering(ctx context.Context, _ *pdpb.IsSnapsho
return nil, errs.ErrGRPCRateLimitExceeded(err)
}
}
if s.IsClosed() {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe placing this check to the head of this function is better?

Copy link
Member Author

Choose a reason for hiding this comment

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

Other functions' checking IsClosed() is inside unaryMiddleware. All of the unaryMiddleware is behind Ratelimit component. So here it is consistent with other places.

Copy link
Contributor

Choose a reason for hiding this comment

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

Uploading image.png…

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 30, 2024
@@ -536,6 +539,11 @@ func (s *GrpcServer) Tso(stream pdpb.PD_TsoServer) error {
return errors.WithStack(err)
}

// TSO uses leader lease to determine validity. No need to check leader here.
if s.IsClosed() {
Copy link
Member

Choose a reason for hiding this comment

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

How about adding a test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added 2bd964d

Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 31, 2024
@okJiang
Copy link
Member Author

okJiang commented Dec 31, 2024

/retest

@okJiang
Copy link
Member Author

okJiang commented Jan 2, 2025

ping @bufferflies

@@ -710,6 +714,9 @@ func (s *GrpcServer) IsSnapshotRecovering(ctx context.Context, _ *pdpb.IsSnapsho
return nil, errs.ErrGRPCRateLimitExceeded(err)
}
}
if s.IsClosed() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Uploading image.png…

Copy link
Contributor

ti-chi-bot bot commented Jan 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bufferflies, rleungx

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [bufferflies,rleungx]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 2, 2025
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 2, 2025
Copy link
Contributor

ti-chi-bot bot commented Jan 2, 2025

[LGTM Timeline notifier]

Timeline:

  • 2024-12-30 10:16:56.864453078 +0000 UTC m=+345552.220457617: ☑️ agreed by rleungx.
  • 2025-01-02 07:17:45.094083965 +0000 UTC m=+594000.450088530: ☑️ agreed by bufferflies.

@ti-chi-bot ti-chi-bot bot merged commit 7a30ebc into tikv:master Jan 2, 2025
23 of 25 checks passed
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Jan 3, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #8969.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #8970.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jan 3, 2025
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jan 3, 2025
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jan 3, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #8971.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Jan 3, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #8972.

@okJiang okJiang deleted the check-server-start branch January 3, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PD may be panic when enabling tidb_enable_tso_follower_proxy and restart PD
4 participants