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

resource_manager: ignore ru metrics for background request #6766

Merged
merged 6 commits into from
Jul 24, 2023

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Jul 6, 2023

What problem does this PR solve?

Issue Number: Ref #5851

What is changed and how does it work?

Check List

Tests

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

Release note

None.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 6, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch

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
Copy link
Contributor

ti-chi-bot bot commented Jul 6, 2023

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-none Denotes a PR that doesn't merit a release note. labels Jul 6, 2023
@ti-chi-bot ti-chi-bot bot requested review from lhy1024 and rleungx July 6, 2023 01:32
@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 6, 2023
@HuSharp HuSharp requested review from nolouch and CabinfeverB and removed request for lhy1024 and rleungx July 6, 2023 01:32
@HuSharp HuSharp force-pushed the ignore_ru_for_background branch 5 times, most recently from 9ee0467 to b3a746e Compare July 6, 2023 08:05
@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. do-not-merge/needs-linked-issue labels Jul 6, 2023
@HuSharp HuSharp marked this pull request as ready for review July 6, 2023 08:40
@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 Jul 6, 2023
@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #6766 (9e01e14) into master (4d9455d) will decrease coverage by 0.11%.
The diff coverage is 74.28%.

❗ Current head 9e01e14 differs from pull request most recent head 295a382. Consider uploading reports for the commit 295a382 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6766      +/-   ##
==========================================
- Coverage   74.32%   74.22%   -0.11%     
==========================================
  Files         414      414              
  Lines       43447    43469      +22     
==========================================
- Hits        32294    32264      -30     
- Misses       8297     8337      +40     
- Partials     2856     2868      +12     
Flag Coverage Δ
unittests 74.22% <74.28%> (-0.11%) ⬇️

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

@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 Jul 6, 2023
@HuSharp HuSharp force-pushed the ignore_ru_for_background branch 2 times, most recently from 6b3ae84 to 5a34eab Compare July 7, 2023 06:35
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2023
client/resource_group/controller/controller.go Outdated Show resolved Hide resolved
@@ -104,6 +104,22 @@ var (
Name: "available_ru",
Help: "Counter of the available RU for all resource groups.",
}, []string{resourceGroupNameLabel})

// Background RU cost metrics.
backgroundReadRequestUnitCost = prometheus.NewCounterVec(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add a type as we disscussed?

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 17, 2023
return false
}

gc.metaLock.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is Rwlock better here as this call can in the hot path

if len(requestResource) == 0 || len(bg.JobTypes) == 0 {
return false
}
if idx := strings.LastIndex(requestResource, "_"); idx != -1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should also implement the fallback to default logic here

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. That means if a non-default resource group's config is not explicitly set, you should uses the default group's rule to check it.

Signed-off-by: husharp <jinhao.hu@pingcap.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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 17, 2023
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm, plz update the proto.

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 20, 2023
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp
Copy link
Member Author

HuSharp commented Jul 24, 2023

@glorv @CabinfeverB friendly ping~

Copy link
Contributor

@glorv glorv left a comment

Choose a reason for hiding this comment

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

LGTM

@nolouch nolouch added the require-LGT1 Indicates that the PR requires an LGTM. label Jul 24, 2023
@nolouch
Copy link
Contributor

nolouch commented Jul 24, 2023

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 24, 2023

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 24, 2023

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

Commit hash: 9e01e14

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 24, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 24, 2023

@HuSharp: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit de985b8 into tikv:master Jul 24, 2023
@HuSharp HuSharp deleted the ignore_ru_for_background branch August 3, 2023 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. require-LGT1 Indicates that the PR requires an LGTM. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants