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

docs: for metasrv maintenance endpoints #878

Merged
merged 3 commits into from
Apr 10, 2024
Merged

docs: for metasrv maintenance endpoints #878

merged 3 commits into from
Apr 10, 2024

Conversation

tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Apr 8, 2024

What's Changed in this PR

This closes #848.

Checklist

  • Please ensure that the content in summary.yml matches the current document structure when you changed the document structure.
  • This change requires follow-up update in localized docs.

@tisonkun tisonkun requested review from nicecui and a team as code owners April 8, 2024 09:00
Copy link

cloudflare-workers-and-pages bot commented Apr 8, 2024

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: c168390
Status: ✅  Deploy successful!
Preview URL: https://a63bf7d2.greptime-docs.pages.dev
Branch Preview URL: https://maintenance.greptime-docs.pages.dev

View logs

@MichaelScofield
Copy link
Contributor

Lack of Chinese version.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

@MichaelScofield Updated. The previous "Chinese version" written in English so I follow the pattern for now 🤣

cc @nicecui

@MichaelScofield
Copy link
Contributor

But why is the Chinese version also written in English?

@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

I think it's for historical reason. We should do a follow-up to translate all of admin-api to Chinese. But I tend not to block this PR.

@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

Or I can translate the new added content anyway.

@nicecui
Copy link
Collaborator

nicecui commented Apr 8, 2024

that's a historical problem, pls translate the new content to Chinese, thank you very much!

@tisonkun tisonkun changed the title docs: for metasrc maintenance endpoints docs: for metasrv maintenance endpoints Apr 8, 2024
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

@nicecui I can schedule to do it in this week, but in another PR. Just don't like to couple multiple things in one PR ..

Copy link
Collaborator

@nicecui nicecui left a comment

Choose a reason for hiding this comment

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

Maybe it is a bit late to discuss the APIs in this document PR...However /maintenance and /maintenance/set are not following the RESTful style of APIs...They should be:

# Get the maintenance status
GET /maintenance
# Modify the maintenance status
PUT /maintenance {status:true}

Then we can write the document as the following:

## /maintenance HTTP endpoint

The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes.

### GET

The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance.

curl -X GET http://localhost:3002/admin/maintenance

### POST
.....

@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

@nicecui our HttpHandler abstraction doesn't pass the HttpMethod:

#[async_trait::async_trait]
pub trait HttpHandler: Send + Sync {
    async fn handle(
        &self,
        path: &str,
        params: &HashMap<String, String>,
    ) -> crate::Result<http::Response<String>>;
}

@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 8, 2024

But we can change it anyway.

@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 9, 2024

DB side changed. Let me update the docs today ..

@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 9, 2024

Generally we should add this doc to v0.8 :D

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 9, 2024

@MichaelScofield @nicecui Updated.

Co-authored-by: Yiran <cuiyiran3@gmail.com>
@tisonkun
Copy link
Contributor Author

tisonkun commented Apr 9, 2024

@nicecui Thanks for the good catches. Updated.

@MichaelScofield MichaelScofield merged commit ce20071 into main Apr 10, 2024
4 checks passed
@MichaelScofield MichaelScofield deleted the maintenance branch April 10, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update docs for feat(metasrv): implement maintenance
3 participants