api(ticdc): return task_status for changefeeds in warning state - #12759
api(ticdc): return task_status for changefeeds in warning state#12759shreyasp-db wants to merge 1 commit into
Conversation
The changefeed detail handlers populate task_status only when the changefeed is in the normal state, so `cdc cli changefeed query` omits the per-capture table assignment for changefeeds in the warning state -- which is often exactly when this information is most needed for debugging. A changefeed in the warning state is still running (its processors are active), so its task statuses remain meaningful. Gate the task_status population on FeedState.IsRunning() (normal OR warning) instead of an exact StateNormal check.
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Contribute Code" section in the development guide. |
|
[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 |
|
Welcome @shreyasp-db! |
|
Hi @shreyasp-db. Thanks for your PR. I'm waiting for a pingcap 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. |
|
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/ok-to-test |
What problem does this PR solve?
Issue Number: none
The changefeed query/detail OpenAPI endpoints normally return
task_status, e.g. (as seen viacdc cli changefeed query -c <CHANGEFEED_ID>, which is just one client of this API):However, when a changefeed is in the
warningstate,task_statusis not returned — which is often exactly when this per-capture table assignment is most needed for debugging. This affects every caller of the query API (theGET /api/v1/changefeeds/{id},GET /api/v2/changefeeds/{id}, and meta-info endpoints), not just thecdc cli.The changefeed detail handlers gate the
task_statuspopulation on an exactinfo.State == model.StateNormalcheck, soGetAllTaskStatusesis skipped for any other state, includingwarning.What is changed and how it works?
A changefeed in the
warningstate is still running (its processors are active), so its task statuses remain meaningful.FeedState.IsRunning()already encodes this exact semantic (StateNormal || StateWarning).This PR replaces the exact
StateNormalcheck withFeedState.IsRunning()in the three changefeed-detail handlers:cdc/api/v1/api.go—getChangefeedcdc/api/v2/changefeed.go—getChangeFeedcdc/api/v2/changefeed.go—getChangeFeedMetaInfoCheck List
Tests
Extended
TestGetChangeFeed(cdc/api/v2) with a table-driven check assertingtask_statusis returned fornormalandwarningstates and omitted forstopped.Questions
Will it cause performance regression or break compatibility?
No. It adds one
GetAllTaskStatusescall for changefeeds in thewarningstate (the same call already made fornormal), and only widens the set of states for whichtask_statusis populated — no field or format changes.Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note