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

server:add querystats sync to follower pd #4922

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

qidi1
Copy link
Contributor

@qidi1 qidi1 commented May 11, 2022

Signed-off-by: qidi1 [email protected]

What problem does this PR solve?

In PD now, QueryStat data is not synchronized and we can't get QueryStat data in non-leader nodes

Issue Number: #pingcap/tidb-dashboard/issues/1209

What is changed and how does it work?

add querystats sync to fllower pd 

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

  • Has persistent data change

Side effects

  • Possible performance regression

Related changes

Release note

None

Manual test

We ran a small cluster locally. On the cluster, test data was generated using the tiup bench tool. The results are shown in the figure below.
image
image

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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. labels May 11, 2022
@ti-chi-bot ti-chi-bot requested review from rleungx and Yisaer May 11, 2022 06:25
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 11, 2022
@rleungx rleungx changed the title server:add querystats sync to fllower pd server:add querystats sync to follower pd May 12, 2022
regionLeaders := resp.GetRegionLeaders()
hasStats := len(stats) == len(regions)
hasBuckets := len(buckets) == len(regions)
hasQueryStats := len(queryStats) == len(regions)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it merge to hasStats?

@@ -161,6 +164,7 @@ func (s *RegionSyncer) RunServer(ctx context.Context, regionNotifier <-chan *cor
RegionStats: stats,
RegionLeaders: leaders,
Buckets: buckets,
QueryStats: queryStats,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can queryStats be merge into ReginStats?

@ti-chi-bot
Copy link
Member

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456, multiple issues should use full syntax for each issue and be separated by a comma, like: Issue Number: close #123, ref #456.

📖 For more info, you can check the "Linking issues" section in the CONTRIBUTING.md.

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 18, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented May 18, 2023

PR needs rebase.

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/needs-linked-issue needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants