pdms: use evict API for TSO primary transfer - #7022
Conversation
TSO service may have multiple keyspace groups. Use the new evict API (POST /api/v1/primary/evict) to transfer all group primaries at once, falling back to the old transfer API for older PD versions. Signed-off-by: tongjian <1045931706@qq.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7022 +/- ##
==========================================
+ Coverage 57.19% 57.54% +0.34%
==========================================
Files 259 262 +3
Lines 33233 38240 +5007
==========================================
+ Hits 19008 22004 +2996
- Misses 12291 14156 +1865
- Partials 1934 2080 +146
🚀 New features to boost your workflow:
|
|
Add a feature gate to change current api call. Hence this api is not available for all pd versions. |
liubog2008
left a comment
There was a problem hiding this comment.
add a new feature gate for this incompatible change
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
TSO service may have multiple keyspace groups, each with its own primary. The old transfer API only handles a single group's primary. This PR uses the new evict API (introduced in tikv/pd#10968) that transfers all keyspace group primaries from the TSO node at once.
What is changed and how does it work?
pdMSPrimaryEvictPrefix = "api/v1/primary/evict"constantTransferPrimary, for TSO service, try the evict API first (POST /tso/api/v1/primary/evict). If it succeeds, return. On failure (old PD without evict support), fall back to the old transfer API (POST /tso/api/v1/primary/transfer).Code changes
Tests
Related changes
Related to tikv/pd#10968