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

client: pay back WRU when the request fails #5941

Merged
merged 3 commits into from
Feb 13, 2023

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Feb 8, 2023

Signed-off-by: JmPotato ghzpotato@gmail.com

What problem does this PR solve?

Issue Number: ref #5851.

What is changed and how does it work?

When a write request fails, pay back the WRU cost we count before.

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 8, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • 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 ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Feb 8, 2023
@ti-chi-bot ti-chi-bot requested a review from HunDunDM February 8, 2023 09:15
@JmPotato JmPotato requested review from CabinfeverB and nolouch and removed request for HunDunDM February 8, 2023 09:15
Signed-off-by: JmPotato <ghzpotato@gmail.com>
}
// A write request may also read data, which should be counted into the RRU cost.
// This part should be counted even if the request does not succeed.
kc.calculateReadCost(consumption, res)

Choose a reason for hiding this comment

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

Just curious, can this logic be leveraged by some one to intentionally issue volume of failing write requests, while no cost at all?

Copy link
Contributor

Choose a reason for hiding this comment

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

Here only pay back the write bytes part.

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

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

/merge

@ti-chi-bot
Copy link
Member

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

/run-all-tests

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
Member

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

Commit hash: 7eb528b

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

codecov bot commented Feb 13, 2023

Codecov Report

Base: 75.22% // Head: 75.15% // Decreases project coverage by -0.07% ⚠️

Coverage data is based on head (6977db9) compared to base (5a8f93d).
Patch coverage: 64.28% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5941      +/-   ##
==========================================
- Coverage   75.22%   75.15%   -0.07%     
==========================================
  Files         362      362              
  Lines       36232    36240       +8     
==========================================
- Hits        27255    27236      -19     
- Misses       6601     6629      +28     
+ Partials     2376     2375       -1     
Flag Coverage Δ
unittests 75.15% <64.28%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
client/resource_manager/client/client.go 62.87% <ø> (ø)
client/resource_manager/client/model.go 73.07% <64.28%> (-6.47%) ⬇️
pkg/utils/metricutil/metricutil.go 62.06% <0.00%> (-31.04%) ⬇️
pkg/tso/local_allocator.go 62.16% <0.00%> (-13.52%) ⬇️
pkg/election/leadership.go 75.25% <0.00%> (-5.16%) ⬇️
pkg/member/member.go 63.68% <0.00%> (-3.69%) ⬇️
pkg/tso/allocator_manager.go 62.58% <0.00%> (-3.39%) ⬇️
server/schedulers/shuffle_hot_region.go 56.66% <0.00%> (-3.34%) ⬇️
server/schedule/labeler/rules.go 87.50% <0.00%> (-2.28%) ⬇️
server/region_syncer/server.go 81.86% <0.00%> (-1.10%) ⬇️
... and 23 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ti-chi-bot ti-chi-bot merged commit 1b1ed83 into tikv:master Feb 13, 2023
@JmPotato JmPotato deleted the pay_back_when_fail branch February 13, 2023 07:56
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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants