-
Notifications
You must be signed in to change notification settings - Fork 753
impl pd cas for key rotation #10208
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
base: master
Are you sure you want to change the base?
impl pd cas for key rotation #10208
Conversation
Signed-off-by: hujiatao0 <hhjjtt110@gmail.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 |
|
Hi @hujiatao0. Thanks for your PR. I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
📝 WalkthroughWalkthroughThese changes introduce a keyspace rotation feature enabling controlled transitions between file IDs. The implementation spans manager APIs (StartRotation, CompleteRotation, GetRotationStatus), storage persistence, structured error handling, path utilities, and HTTP endpoints for the full workflow. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Handler as HTTP Handler
participant Manager as Manager
participant Storage as StorageEndpoint
Client->>Handler: POST /keyspaces/id/:id/rotation/start<br/>(CurrentFileID, NextFileID)
Handler->>Handler: Validate keyspace ID & parse params
Handler->>Manager: StartRotation(StartRotationRequest)
Manager->>Manager: Validate NextFileID vs CurrentFileID
Manager->>Storage: LoadKeyspaceRotation(txn, keyspaceID)
Storage-->>Manager: KeyspaceRotationMeta or nil
Manager->>Manager: Create/update rotation state
Manager->>Storage: SaveKeyspaceRotation(txn, meta)
Storage-->>Manager: error or success
Manager-->>Handler: RotationMeta or RotationError
Handler->>Handler: Map error to HTTP status (400/409/500)
Handler-->>Client: 200 RotationMeta or error response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md. |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (1.38%) 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 @@
## master #10208 +/- ##
==========================================
- Coverage 78.59% 78.37% -0.23%
==========================================
Files 520 522 +2
Lines 70014 70276 +262
==========================================
+ Hits 55028 55079 +51
- Misses 11008 11222 +214
+ Partials 3978 3975 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
What problem does this PR solve?
Issue Number: Close #xxx
What is changed and how does it work?
Check List
Tests
Code changes
Related changes
pingcap/docs/pingcap/docs-cn:pingcap/tiup:Release note
Summary by CodeRabbit