-
Couldn't load subscription status.
- Fork 28
metrics: fix changefeed resolved ts (#2693) #2855
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
metrics: fix changefeed resolved ts (#2693) #2855
Conversation
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
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. |
Summary of ChangesHello @ti-chi-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the system's approach to collecting and reporting changefeed resolved timestamps. By centralizing this logic within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request successfully refactors the changefeed resolved timestamp metric collection by moving the responsibility from eventStore to eventService. This is a good architectural improvement that simplifies the eventStore and centralizes the metric aggregation logic. The changes are well-implemented and the increased reporting frequency will improve metric accuracy. I've identified one minor issue where metrics might be reported for a changefeed with no dispatchers, which I've detailed in a specific comment.
| states = append(states, &logservicepb.ChangefeedStateEntry{ | ||
| ChangefeedID: cfStatus.changefeedID.ToPB(), | ||
| ResolvedTs: minResolvedTs, | ||
| }) |
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.
If a changefeed has no dispatchers (e.g., in a transient state during removal), minResolvedTs will remain math.MaxUint64. Sending this value to the log coordinator causes it to log a "this should not happen" warning. The previous implementation in eventStore handled this by checking if any dispatchers were found before reporting the metric. A similar check should be added here to avoid reporting metrics for changefeeds without dispatchers.
if minResolvedTs != math.MaxUint64 {
states = append(states, &logservicepb.ChangefeedStateEntry{
ChangefeedID: cfStatus.changefeedID.ToPB(),
ResolvedTs: minResolvedTs,
})
}|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tenfyzhong The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is an automated cherry-pick of #2693
What problem does this PR solve?
Issue Number: close #2694
What is changed and how it works?
eventStoreto theeventService'smetricsCollector.eventStoreno longer maintainschangefeedStatstructures or directly collects/reports changefeed-level metrics, simplifying its internal logic.eventServicenow aggregates minimum resolved timestamps per changefeed and reports them to the log coordinator more frequently (every 1 second).Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note