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

http_*: add a HTTP API to list changefeed info (#1917) #1955

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #1917

What problem does this PR solve?

#1869

What is changed and how it works?

Add a HTTP API to list changefeed info.
Add a HTTP API to check the health of CDC server. (It only return a response with 200 OK and empty body.)

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  1. list default changefeeds
$ curl -X GET http://127.0.0.1:8300/api/v1/changefeeds
[
 {
  "id": "changefeed-test-1",
  "state": "normal",
  "tso": 425364256174112775,
  "checkpoint": "2021-06-02 20:11:04.922",
  "error": null
 },
 {
  "id": "test1",
  "state": "normal",
  "tso": 425364256174112775,
  "checkpoint": "2021-06-02 20:11:04.922",
  "error": null
 }
]
  1. list all changefeeds.
$ curl -X GET http://127.0.0.1:8300/api/v1/changefeeds?state=all
[
 {
  "id": "changefeed-test-1",
  "state": "normal",
  "tso": 425364263569195009,
  "checkpoint": "2021-06-02 20:11:33.132",
  "error": null
 },
 {
  "id": "test1",
  "state": "normal",
  "tso": 425364263569195009,
  "checkpoint": "2021-06-02 20:11:33.132",
  "error": null
 },
 {
  "id": "test2",
  "state": "removed",
  "tso": 425364254063853571,
  "checkpoint": "2021-06-02 20:10:56.872",
  "error": null
 }
]
  1. list normal / stopped / removed changefeed
$ curl -X GET http://127.0.0.1:8300/api/v1/changefeeds?state=normal

[
 {
  "id": "test1",
  "state": "normal",
  "checkpoint-tso": 425413530255884289,
  "checkpoint-time": "2021-06-05 00:23:50.627",
  "error": null
 },
 {
  "id": "test2",
  "state": "normal",
  "checkpoint-tso": 425413530255884289,
  "checkpoint-time": "2021-06-05 00:23:50.627",
  "error": null
 }
]

$ curl -X GET http://127.0.0.1:8300/api/v1/changefeeds?state=stopped

[
 {
  "id": "test4",
  "state": "stopped",
  "checkpoint-tso": 425412960562708481,
  "checkpoint-time": "2021-06-04 23:47:37.420",
  "error": null
 }
]

$ curl -X GET http://127.0.0.1:8300/api/v1/changefeeds?state=removed

[
 {
  "id": "test3",
  "state": "removed",
  "checkpoint-tso": 425412963750903809,
  "checkpoint-time": "2021-06-04 23:47:49.582",
  "error": null
 }
  1. test POST method
$ curl -POST http://127.0.0.1:8300/api/v1/changefeeds

{
 "error": "this api supports GET method only",
 "errorCode": "CDC:ErrSupportGetOnly"
}
  1. check health of CDC server
$ curl -I -X GET  http://127.0.0.1:8300/api/v1/health

HTTP/1.1 200 OK
Date: Fri, 04 Jun 2021 04:05:56 GMT
Content-Length: 0

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release note

  • No release note

@ti-chi-bot ti-chi-bot added status/ptal Could you please take a look? size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-5.0 This PR is cherry-picked to release-5.0 from a source PR. labels Jun 5, 2021
@ti-chi-bot ti-chi-bot requested a review from amyangfei June 5, 2021 11:57
@ti-chi-bot ti-chi-bot requested a review from zier-one June 5, 2021 11:57
@lonng lonng added this to the v5.0.3 milestone Jun 10, 2021
Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

Approve in advance, please merge this PR once it's ready.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 17, 2021
@lonng lonng added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Jun 22, 2021
@amyangfei
Copy link
Contributor

Does this cherry-pick rely on #2081 @asddongmen

@asddongmen
Copy link
Contributor

Does this cherry-pick rely on #2081 @asddongmen

yeh @amyangfei

@amyangfei
Copy link
Contributor

Please help to merge release-5.0 and resolve conflicts @asddongmen

@ti-chi-bot
Copy link
Member Author

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • amyangfei
  • overvenus

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 22, 2021
@amyangfei
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member Author

This pull request has been accepted and is ready to merge.

Commit hash: 15b17d2

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 22, 2021
@ti-chi-bot
Copy link
Member Author

@ti-chi-bot: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit e7c3a0f into pingcap:release-5.0 Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look? type/cherry-pick-for-release-5.0 This PR is cherry-picked to release-5.0 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants