tools: isolate keyspace according to the given label (#10121)#10172
Conversation
ref tikv#10122 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@rleungx This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. DetailsInstructions 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. |
|
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 You can disable this status message by setting the 📝 WalkthroughWalkthroughThe changes introduce a new HTTP API method for deleting placement rule bundles by group in the client library, add CLI subcommands for managing keyspace placement rules and viewing key ranges in pd-ctl, and provide comprehensive test coverage for keyspace placement functionality. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Signed-off-by: Ryan Leung <rleungx@gmail.com>
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
/hold cancel |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@tools/pd-ctl/pdctl/command/keyspace_command.go`:
- Around line 472-486: Replace the current fmt.Sscanf parsing of keyspaceIDStr
with strconv.ParseUint(keyspaceIDStr, 10, 32) in both setPlacementCommandFunc
and revertPlacementCommandFunc so parsing enforces 32-bit width (preventing
wraparound); on error, print the parse error via cmd.PrintErrf and return, then
safely cast the parsed uint64 result to uint32 (e.g., uint32(parsed)) and
continue to perform the existing bounds check against
constants.DefaultKeyspaceID and constants.MaxKeyspaceID.
🧹 Nitpick comments (1)
tools/pd-ctl/pdctl/command/keyspace_command.go (1)
523-534: Consider surfacing replica count as a flag.
There’s a TODO to makeCountconfigurable; adding a CLI flag (or documenting a follow‑up) would close the loop.If you want, I can draft a flag-based implementation and tests.
Signed-off-by: Ryan Leung <rleungx@gmail.com>
|
/retest |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (49.73%) is below the target coverage (74.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## release-nextgen-20251011 #10172 +/- ##
============================================================
- Coverage 78.73% 78.61% -0.12%
============================================================
Files 491 491
Lines 66124 66320 +196
============================================================
+ Hits 52060 52136 +76
- Misses 10308 10417 +109
- Partials 3756 3767 +11
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
[LGTM Timeline notifier]Timeline:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bufferflies, lhy1024, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
17478bb
into
tikv:release-nextgen-20251011
This is an automated cherry-pick of #10121
What problem does this PR solve?
Issue Number: ref #10122
What is changed and how does it work?
Check List
Tests
Release note
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.