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/transfer: Added checks for available tso nodes #8530

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Aug 14, 2024

What problem does this PR solve?

Issue Number: Close #8529

What is changed and how does it work?

For a group only the DefaultKeyspaceGroupReplicaCount nodes can be transferred, we need to ensure that we can only transfer between available nodes.

Check List

Tests

  • Integration test

Release note

None.

Signed-off-by: husharp <ihusharp@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 14, 2024
@@ -65,7 +66,7 @@ func (suite *memberTestSuite) SetupTest() {

// TSO
nodes := make(map[string]bs.Server)
for i := 0; i < 3; i++ {
for i := 0; i < constant.DefaultKeyspaceGroupReplicaCount; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

why reduce 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.

Because DefaultKeyspaceGroupReplicaCount limits the number of tso nodes.

Copy link
Member

Choose a reason for hiding this comment

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

We do need to test the case whose TSO node is more than DefaultKeyspaceGroupReplicaCount.

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 restrictions and checks to the TransferPrimary function and refined the tests.

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.61%. Comparing base (61a85e5) to head (9c9d0b3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8530      +/-   ##
==========================================
- Coverage   77.64%   77.61%   -0.04%     
==========================================
  Files         474      474              
  Lines       61877    61883       +6     
==========================================
- Hits        48044    48029      -15     
- Misses      10300    10340      +40     
+ Partials     3533     3514      -19     
Flag Coverage Δ
unittests 77.61% <100.00%> (-0.04%) ⬇️

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

Signed-off-by: husharp <ihusharp@gmail.com>
@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 Aug 15, 2024
@HuSharp HuSharp changed the title member_test: refine primary test mcs/transfer: Added checks for available tso nodes Aug 15, 2024
@HuSharp HuSharp requested a review from JmPotato August 16, 2024 03:31
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 22, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Aug 26, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 26, 2024

[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

Needs approval from an approver in each of these files:

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 approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 26, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-22 09:49:40.244125511 +0000 UTC m=+431775.378575628: ☑️ agreed by okJiang.
  • 2024-08-26 08:00:18.838623483 +0000 UTC m=+770813.973073600: ☑️ agreed by rleungx.

@ti-chi-bot ti-chi-bot bot merged commit 6998fb5 into tikv:master Aug 26, 2024
25 checks passed
@HuSharp HuSharp deleted the refine_primary_test branch August 26, 2024 08:10
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 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestTransferPrimary is flaky
4 participants