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

br: revert new introduced BatchScanRegions to keep compatibility #54365

Merged
merged 4 commits into from
Jul 3, 2024

Conversation

you06
Copy link
Contributor

@you06 you06 commented Jul 1, 2024

What problem does this PR solve?

Issue Number: close #54313 #54341

Problem Summary:

What changed and how does it work?

We have deprecated the ScanRegion and introduce BatchScanRegions as a replacement in v8.2. However, to keep compatibility(v8.2 br/lightning should work with previous TiDB clusters), the tools should keep using the old supported ScanRegion.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

The integration test case which import into 8.1 tidb with this PR's lightning is passed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 1, 2024
Copy link

tiprow bot commented Jul 1, 2024

Hi @you06. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

@you06 you06 changed the title br: revert new introduced BatchScanRegions to keep compability br: revert new introduced BatchScanRegions to keep compatibility Jul 1, 2024
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 56.5109%. Comparing base (c983546) to head (fe50606).
Report is 34 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54365         +/-   ##
=================================================
- Coverage   72.8081%   56.5109%   -16.2972%     
=================================================
  Files          1527       1679        +152     
  Lines        435913     622548     +186635     
=================================================
+ Hits         317380     351808      +34428     
- Misses        98884     246385     +147501     
- Partials      19649      24355       +4706     
Flag Coverage Δ
integration 38.3881% <40.0000%> (?)
unit 71.8139% <40.0000%> (+0.0142%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 58.6880% <33.3333%> (+12.5732%) ⬆️

@you06
Copy link
Contributor Author

you06 commented Jul 1, 2024

/retest

Copy link

tiprow bot commented Jul 1, 2024

@you06: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes-sigs/prow repository.

Signed-off-by: you06 <[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. labels Jul 3, 2024
@@ -63,7 +63,8 @@ func (c *codecPDClient) ScanRegions(
endKey = codec.EncodeBytes(nil, endKey)
}

regions, err := c.Client.BatchScanRegions(ctx, []pd.KeyRange{{StartKey: startKey, EndKey: endKey}}, limit, opts...)
//nolint:staticcheck
regions, err := c.Client.ScanRegions(ctx, startKey, endKey, limit, opts...)
Copy link
Contributor

Choose a reason for hiding this comment

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

those can be removed if we have do it in pd client-go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I don't get your mean, I just revert it to the old version.

Copy link
Contributor

Choose a reason for hiding this comment

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

i mean if we have make interface compatible in client-go side, we can still use BatchScanRegions here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a little weird that pd's client handle unimplement error, and the compatibility is made out of pd client. So I switch back to old interface here.

Signed-off-by: you06 <[email protected]>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 3, 2024
Copy link

ti-chi-bot bot commented Jul 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, YuJuncen

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

ti-chi-bot bot commented Jul 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-03 11:12:51.595983336 +0000 UTC m=+1409298.081472168: ☑️ agreed by cfzjywxk.
  • 2024-07-03 11:27:33.715596864 +0000 UTC m=+1410180.201085696: ☑️ agreed by YuJuncen.

Signed-off-by: you06 <[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 Jul 3, 2024
@you06
Copy link
Contributor Author

you06 commented Jul 3, 2024

/retest

Copy link

tiprow bot commented Jul 3, 2024

@you06: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes-sigs/prow repository.

@cfzjywxk
Copy link
Contributor

cfzjywxk commented Jul 3, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jul 3, 2024
@ti-chi-bot ti-chi-bot bot merged commit c71eece into pingcap:master Jul 3, 2024
24 of 33 checks passed
@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.2 ok-to-test Indicates a PR is ready to be tested. 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.

tidb lightning: daily run find 'Lightning is stuck" for hours
5 participants