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

owner(cdc): fix two metrics problems #4703

Merged
merged 13 commits into from
Mar 1, 2022

Conversation

liuzix
Copy link
Contributor

@liuzix liuzix commented Feb 25, 2022

What problem does this PR solve?

Issue Number: close #4714

What is changed and how it works?

  • Fixed checkpoint reporting to Prometheus when the checkpoint cannot be advanced.
  • Fixed "Table count maintained by owner" when the new scheduler is enabled.
  • Optimized the data structures in util.TableSet so that reporting the table count metrics will not hinder performance.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test

The image below shows that this PR fix both problems. Before this PR, during scheduling (i.e. there are WIP tables), the checkpoint metrics should lack data.
image

Related changes

  • Need to cherry-pick to the release branch

Release note

Fix checkpoint metrics when tables are being scheduled.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 25, 2022

[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 do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 25, 2022
@liuzix
Copy link
Contributor Author

liuzix commented Feb 25, 2022

/run-integration-tests

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 25, 2022
@3AceShowHand
Copy link
Contributor

/run-all-tests

@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-integration-tests

@ti-chi-bot ti-chi-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 Feb 28, 2022
@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-integration-tests

@liuzix liuzix changed the title [WIP]owner(cdc): fix metrics not updated when dispatching tables owner(cdc): fix two metrics problems Feb 28, 2022
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 28, 2022
@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-integration-tests

@liuzix liuzix requested review from overvenus, amyangfei and asddongmen and removed request for amyangfei February 28, 2022 07:46
@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-integration-tests

if !ok {
log.Panic("unreachable", zap.Int64("tableID", tableID))
}
statusCountEntry[record.Status]--
Copy link
Member

Choose a reason for hiding this comment

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

Will it underflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other states maintained in TableSet is sufficient to guarantee that there is no underflow.

cdc/owner/changefeed.go Show resolved Hide resolved
@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-integration-tests
/run-leak-tests

@liuzix liuzix added the type/bugfix This PR fixes a bug. label Feb 28, 2022
@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-check-issue-triage-complete

@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. and removed do-not-merge/needs-triage-completed labels Feb 28, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2022

Codecov Report

Merging #4703 (eb6a077) into master (9607554) will decrease coverage by 0.3656%.
The diff coverage is 52.9739%.

Flag Coverage Δ
cdc 59.9211% <52.9739%> (-0.0012%) ⬇️
dm 51.3893% <ø> (-0.6396%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             master      #4703        +/-   ##
================================================
- Coverage   55.6402%   55.2746%   -0.3657%     
================================================
  Files           494        518        +24     
  Lines         61283      64033      +2750     
================================================
+ Hits          34098      35394      +1296     
- Misses        23750      25146      +1396     
- Partials       3435       3493        +58     

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 28, 2022
@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 Feb 28, 2022
@overvenus
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: eb6a077

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 28, 2022
@liuzix
Copy link
Contributor Author

liuzix commented Feb 28, 2022

/run-kafka-integration-test

2 similar comments
@liuzix
Copy link
Contributor Author

liuzix commented Mar 1, 2022

/run-kafka-integration-test

@liuzix
Copy link
Contributor Author

liuzix commented Mar 1, 2022

/run-kafka-integration-test

@liuzix
Copy link
Contributor Author

liuzix commented Mar 1, 2022

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit d141ee6 into pingcap:master Mar 1, 2022
ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Mar 1, 2022
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4729.

ti-chi-bot added a commit that referenced this pull request Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiCDC fails to report checkpoint metrics with pending scheduler operations
6 participants