Skip to content

data_validator: initialize the metrics in Start() instead of constructor#12603

Open
kennytm wants to merge 1 commit intopingcap:masterfrom
kennytm:fix-12601
Open

data_validator: initialize the metrics in Start() instead of constructor#12603
kennytm wants to merge 1 commit intopingcap:masterfrom
kennytm:fix-12601

Conversation

@kennytm
Copy link
Copy Markdown
Contributor

@kennytm kennytm commented Apr 13, 2026

What problem does this PR solve?

Issue Number: close #12601

What is changed and how it works?

Move the metrics initialization to Start() (which calls initialize()) rather than in the constructor which is called only once in the entire lifetime.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

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

Release note

Metrics of a restarted DM validator are no longer hidden.

@kennytm kennytm added the area/dm Issues or PRs related to DM. label Apr 13, 2026
@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 13, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign d3hunter for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

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

Details Needs approval from an approver in each of these files:

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 added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 13, 2026
Copy link
Copy Markdown

@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 moves the initialization of vmetric from the NewContinuousDataValidator constructor to the initialize method in data_validator.go. Additionally, it updates the unit tests in data_validator_test.go to verify that vmetric is correctly initialized upon starting the validator and is re-initialized when the validator is restarted. I have no feedback to provide as there were no review comments.

@kennytm
Copy link
Copy Markdown
Contributor Author

kennytm commented Apr 13, 2026

/retest

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Apr 13, 2026

@kennytm: 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-dm-integration-test-next-gen ec1f18b link false /test pull-dm-integration-test-next-gen

Full PR test history. Your PR dashboard.

Details

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.

@kennytm
Copy link
Copy Markdown
Contributor Author

kennytm commented Apr 17, 2026

/retest-required

@kennytm
Copy link
Copy Markdown
Contributor Author

kennytm commented Apr 22, 2026

/cc @GMHDBJD @OliverS929

@ti-chi-bot ti-chi-bot Bot requested review from GMHDBJD and OliverS929 April 22, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dm Issues or PRs related to DM. do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restarting DM validator won't bring the metrics back

1 participant