8000 eventService: improve metric collection logic by asddongmen · Pull Request #1376 · pingcap/ticdc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

eventService: improve metric collection logic #1376

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

Merged
merged 13 commits into from
May 28, 2025

Conversation

asddongmen
Copy link
Collaborator
@asddongmen asddongmen commented May 26, 2025

What problem does this PR solve?

Issue Number: ref #1307

What is changed and how it works?

Extract the metric collecting logic from event_broker.go to make the code more readable.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

Signed-off-by: dongmen <414110582@qq.com>
Copy link
ti-chi-bot bot commented May 26, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 26, 2025
Copy link
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @asddongmen, 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!

Summary of Changes

Hello! Gemini here, providing a summary of this pull request to help everyone quickly understand the changes. Based on the title "eventStore: debug" and the patch content, it appears this PR is intended for debugging purposes within the eventStore component, specifically related to the event broker's scan logic. The primary change involves temporarily commenting out a section of code that constrains the data scan range based on the table's DDL state. This modification seems aimed at observing behavior without this specific constraint, likely to diagnose an issue.

Highlights

  • Debugging: This PR is tagged as a debugging effort for the eventStore component.
  • Event Broker Scan Logic: A specific part of the event broker's scan logic in checkNeedScan has been modified.
  • DDL State Constraint Commented Out: The code that limits the scan EndTs based on the table's DDL resolved timestamp has been commented out.

Changelog

  • pkg/eventservice/event_broker.go
    • Commented out lines 390-392 in the checkNeedScan function. This disables the logic that constrains the data scan range's end timestamp (dataRange.EndTs) to the table's DDL state's resolved timestamp (ddlState.ResolvedTs). This change is likely for debugging purposes.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and 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 to provide feedback.

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.


Code lines vanish, just for a while,
To see how the system will smile.
Debugging's the game,
To find fault or fame,
Then uncomment with a new style.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 26, 2025
Copy link
@gemini-code-assist gemini-code-assist bot left a 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, titled "eventStore: debug", comments out a critical piece of logic in the checkNeedScan function. The PR description lacks details about the purpose and impact of this change, which makes it difficult to assess its intent fully.

The primary concern is the removal of the constraint that caps the dataRange.EndTs by ddlState.ResolvedTs (which is the schemaStore's global resolved timestamp). This constraint appears vital for ensuring data consistency by preventing the system from scanning DML events beyond the point for which schema information is reliably resolved. Commenting this out could lead to correctness issues or performance degradation.

It's crucial to understand if this is a temporary debugging measure. If so, it should be clearly documented with a TODO and a plan for reversion. If it's intended as a permanent change, a thorough justification and analysis of its impact on correctness and performance are required.

Summary of Findings

  • Potential Correctness Issue due to Removed DDL State Constraint: Commenting out the code that constrains dataRange.EndTs by ddlState.ResolvedTs in checkNeedScan (pkg/eventservice/event_broker.go) is a critical concern. This may lead to scanning DML events beyond the schema store's resolved DDL state, potentially causing DMLs to be processed with stale schema information or leading to performance issues due to increased blocking in schemaStore.GetTableInfo. This change needs strong justification or should be reverted.
  • Lack of Pull Request Context: The pull request title ("eventStore: debug") and description are insufficient to understand the intent, scope, and impact of the changes. Clearer communication is needed, especially for changes affecting core logic.

Merge Readiness

This pull request, in its current state, is not ready to be merged. The critical issue identified—commenting out the DDL state constraint—poses a significant risk to data correctness and system stability. This change must be reverted or a very compelling justification for its removal, along with evidence that correctness is not compromised, must be provided.

Additionally, the pull request lacks essential context in its title and description, making it difficult to review effectively. Please update the PR details to reflect the purpose and impact of these changes.

I am unable to approve this pull request. It should be thoroughly re-evaluated and potentially reverted before considering it for merge.

Copy link
ti-chi-bot bot commented May 26, 2025

@gemini-code-assist[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Code Review

This pull request, titled "eventStore: debug", comments out a critical piece of logic in the checkNeedScan function. The PR description lacks details about the purpose and impact of this change, which makes it difficult to assess its intent fully.

The primary concern is the removal of the constraint that caps the dataRange.EndTs by ddlState.ResolvedTs (which is the schemaStore's global resolved timestamp). This constraint appears vital for ensuring data consistency by preventing the system from scanning DML events beyond the point for which schema information is reliably resolved. Commenting this out could lead to correctness issues or performance degradation.

It's crucial to understand if this is a temporary debugging measure. If so, it should be clearly documented with a TODO and a plan for reversion. If it's intended as a permanent change, a thorough justification and analysis of its impact on correctness and performance are required.

Summary of Findings

  • Potential Correctness Issue due to Removed DDL State Constraint: Commenting out the code that constrains dataRange.EndTs by ddlState.ResolvedTs in checkNeedScan (pkg/eventservice/event_broker.go) is a critical concern. This may lead to scanning DML events beyond the schema store's resolved DDL state, potentially causing DMLs to be processed with stale schema information or leading to performance issues due to increased blocking in schemaStore.GetTableInfo. This change needs strong justification or should be reverted.
  • Lack of Pull Request Context: The pull request title ("eventStore: debug") and description are insufficient to understand the intent, scope, and impact of the changes. Clearer communication is needed, especially for changes affecting core logic.

Merge Readiness

This pull request, in its current state, is not ready to be merged. The critical issue identified—commenting out the DDL state constraint—poses a significant risk to data correctness and system stability. This change must be reverted or a very compelling justification for its removal, along with evidence that correctness is not compromised, must be provided.

Additionally, the pull request lacks essential context in its title and description, making it difficult to review effectively. Please update the PR details to reflect the purpose and impact of these changes.

I am unable to approve this pull request. It should be thoroughly re-evaluated and potentially reverted before considering it for merge.

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.

Signed-off-by: dongmen <414110582@qq.com>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 26, 2025
Signed-off-by: dongmen <414110582@qq.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 27, 2025
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 27, 2025
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
Signed-off-by: dongmen <414110582@qq.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 28, 2025
@asddongmen asddongmen changed the title eventStore: debug eventService: improve metric collection logic May 28, 2025
@asddongmen asddongmen marked this pull request as ready for review May 28, 2025 04:25
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 28, 2025
@asddongmen asddongmen marked this pull request as draft May 28, 2025 04:26
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 28, 2025
@asddongmen asddongmen marked this pull request as ready for review May 28, 2025 04:37
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 28, 2025
Copy link
ti-chi-bot bot commented May 28, 2025

@asddongmen: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cdc-pulsar-integration-light 4ae0303 link false /test pull-cdc-pulsar-integration-light

Full PR test history. Your PR dashboard.

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.

Copy link
ti-chi-bot bot commented May 28, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-28 07:06:26.025840354 +0000 UTC m=+2607.087857961: ☑️ agreed by 3AceShowHand.

Copy link
ti-chi-bot bot commented May 28, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand, wk989898

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:
  • OWNERS [3AceShowHand,wk989898]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot merged commit 9c17deb into pingcap:master May 28, 2025
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0