-
Notifications
You must be signed in to change notification settings - Fork 743
server/api: Add PD HTTP Endpoints for PiTR Restore Mode Marker #9655
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?
Conversation
…recovering) Add new HTTP endpoints for PITR (Point-in-Time Recovery) coordination: - GET /admin/cluster/markers/pitr-recovering - POST /admin/cluster/markers/pitr-recovering•• - DELETE /admin/cluster/markers/pitr-recovering This provides a centralized way for TiDB Operator to coordinate PITR operations across multi-cluster deployments, following the same pattern as existing snapshot-recovering endpoints. Signed-off-by: h-wang4 <[email protected]>
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @HaoW30. 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. 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. |
Now you can start all CI jobs with |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (68.75%) 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 #9655 +/- ##
==========================================
+ Coverage 76.61% 76.70% +0.09%
==========================================
Files 482 482
Lines 76184 76232 +48
==========================================
+ Hits 58367 58474 +107
+ Misses 14231 14179 -52
+ Partials 3586 3579 -7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
server/api/admin.go
Outdated
h.rd.Text(w, http.StatusInternalServerError, err.Error()) | ||
return | ||
} | ||
type resStruct struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using a public struct? It is same as L183
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
FYI, If you submit a PR on tidb-operator, please link it here. I think it's okay to wait until both PRs are ready before merging. |
@okJiang sounds good, will do |
Signed-off-by: h-wang4 <[email protected]>
@HaoW30 Hey, how’s the progress recently? Have you encountered any difficulties? |
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md. |
Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits. 📝 Please follow instructions in the contributing guide to update your commits with the DCO Full details of the Developer Certificate of Origin can be found at developercertificate.org. The list of commits missing DCO signoff:
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. I understand the commands that are listed here. |
@okJiang Thanks! We've tested this patch with BR/operator changes locally end-to-end and made sure things work for the multi-k8s cluster restore scenario. We're preparing the relevant upstream PR for BR. Will link it here once ready. |
What problem does this PR solve?
Issue Number: Close #9638
What is changed and how does it work?
This PR adds a new set of PD HTTP endpoints (v1 API) to support a pitr-recovering marker, following the same pattern as the existing snapshot-recovering marker implementation.
New endpoints:
GET /admin/cluster/markers/pitr-recovering
– check whether the pitr recovery marker is setPOST /admin/cluster/markers/pitr-recovering
– mark the cluster as under pitr recovery••DELETE /admin/cluster/markers/pitr-recovering
– clear the pitr recovery markerImplementation details:
Keypath support: Added
pitrRecoveringMarkPathFormat
andPitrRecoveringMarkPath()
function inpkg/utils/keypath/absolute_key_path.go
Server functions: Added three new methods to
server/server.go
:MarkPitrRecovering()
- Sets the PITR recovery marker in etcdIsPitrRecovering(ctx)
- Checks if PITR recovery marker existsUnmarkPitrRecovering(ctx)
- Removes the PITR recovery markerHTTP handlers: Added corresponding HTTP handlers in
server/api/admin.go
:markPitrRecovering
- POST handlerisPitrRecovering
- GET handler (returns JSON withmarked
boolean field)unmarkPitrRecovering
- DELETE handlerRouting: Added three route registrations in
server/api/router.go
with proper audit loggingTesting: Added comprehensive test
TestMarkPitrRecovering
that validates:Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note