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

split_controller : add logging for hot keys and region split key #17010

Closed
wants to merge 14 commits into from

Conversation

mittalrishabh
Copy link

@mittalrishabh mittalrishabh commented May 13, 2024

What is changed and how it works?

Issue Number: Close #17024

What's Changed:
Printing more logs around the split key and hot keys in a region. It might help us in identifying the hot keys in a region.


Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note


Copy link
Contributor

ti-chi-bot bot commented May 13, 2024

[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.

Copy link
Contributor

ti-chi-bot bot commented May 13, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

Copy link
Contributor

ti-chi-bot bot commented May 13, 2024

Hi @mittalrishabh. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

Copy link
Contributor

ti-chi-bot bot commented May 13, 2024

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be approved by the approvers firstly.
  2. AFTER it has been approved by approvers, please wait for the cherry-pick merging approval from triage owners.

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.

@ti-chi-bot ti-chi-bot bot added size/XS and removed size/XXL labels May 13, 2024
@mittalrishabh mittalrishabh changed the title add logging split_controller : add logging for hot keys and region splut key May 13, 2024
@mittalrishabh mittalrishabh changed the title split_controller : add logging for hot keys and region splut key split_controller : add logging for hot keys and region split key May 13, 2024
@ti-chi-bot ti-chi-bot bot added size/S and removed size/XS labels May 15, 2024
@cfzjywxk cfzjywxk requested a review from JmPotato May 16, 2024 01:55
@cfzjywxk
Copy link
Collaborator

@mittalrishabh
There is some lint errors

2024-05-15T21:47:08.906Z] + git diff --quiet

[2024-05-15T21:47:08.906Z] + git diff

[2024-05-15T21:47:08.906Z] diff --git a/components/raftstore/src/store/worker/split_controller.rs b/components/raftstore/src/store/worker/split_controller.rs

[2024-05-15T21:47:08.906Z] index f6a82851a..df6fdbd35 100644

[2024-05-15T21:47:08.906Z] --- a/components/raftstore/src/store/worker/split_controller.rs

[2024-05-15T21:47:08.906Z] +++ b/components/raftstore/src/store/worker/split_controller.rs

[2024-05-15T21:47:08.906Z] @@ -686,7 +686,6 @@ impl AutoSplitController {

[2024-05-15T21:47:08.906Z]          let mut region_key_range_cpu_time_map = HashMap::new();

[2024-05-15T21:47:08.906Z]          cpu_stats_vec.iter().for_each(|cpu_stats| {

[2024-05-15T21:47:08.906Z]              cpu_stats.records.iter().for_each(|(tag, record)| {

[2024-05-15T21:47:08.906Z] -

[2024-05-15T21:47:08.906Z]                  // Calculate the Region ID -> CPU Time.

[2024-05-15T21:47:08.906Z]                  region_cpu_map

[2024-05-15T21:47:08.906Z]                      .entry(tag.region_id)

[2024-05-15T21:47:08.906Z] @@ -860,7 +859,7 @@ impl AutoSplitController {

[2024-05-15T21:47:08.906Z]                          info!(

[2024-05-15T21:47:08.906Z]                              "DEBUG : load based split : expensive range";

[2024-05-15T21:47:08.906Z]                              "hot start_key" => log_wrappers::Value::key(&recorder.hottest_key_range.as_ref().unwrap().start_key),

[2024-05-15T21:47:08.906Z] -                            "hot end_key" => log_wrappers::Value::key(&recorder.hottest_key_range.as_ref().unwrap().end_key),  

[2024-05-15T21:47:08.906Z] +                            "hot end_key" => log_wrappers::Value::key(&recorder.hottest_key_range.as_ref().unwrap().end_key),

[2024-05-15T21:47:08.906Z]                          );

[2024-05-15T21:47:08.906Z]                      }

[2024-05-15T21:47:08.906Z]                      self.recorders.remove(&region_id);

[2024-05-15T21:47:08.906Z] + echo Please make format and run tests before creating a PR

[2024-05-15T21:47:08.906Z] Please make format and run tests before creating a PR

[2024-05-15T21:47:08.906Z] + exit 1

The make dev could be used to check related formats.

@mittalrishabh
Copy link
Author

@JmPotato please review this PR. CI is passing now.

Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
mittalrishabh and others added 7 commits May 23, 2024 20:14
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
close tikv#16969

fix overflow panic in `conv`

Signed-off-by: gengliqi <gengliqiii@gmail.com>

Co-authored-by: gengliqi <gengliqiii@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
…ikv#16987)

close tikv#16962

fix a `cast_string_to_decimal` truncate bug

Signed-off-by: gengliqi <gengliqiii@gmail.com>

Co-authored-by: gengliqi <gengliqiii@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
Signed-off-by: rishabh_mittal <mittalrishabh@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/S and removed size/L labels May 24, 2024
@cfzjywxk
Copy link
Collaborator

Hello @mittalrishabh

Could you file an PR for master branch first. The cherry-pick process for the release branch is relatively complex. In principle, only major bug fixes will be cherry-picked to the release branch to maintain its stability. Cherry-picking to the release branch requires bug triage.

@mittalrishabh
Copy link
Author

Hello @mittalrishabh

Could you file an PR for master branch first. The cherry-pick process for the release branch is relatively complex. In principle, only major bug fixes will be cherry-picked to the release branch to maintain its stability. Cherry-picking to the release branch requires bug triage.

created a PR #17061

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants