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

Fix for "Expected quota value mismatch" failure in CDT and UTs #8623

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

dlex
Copy link
Contributor

@dlex dlex commented Feb 3, 2023

Fixes #8613

UTs are added for some specific cases with algorithm used internally by snc_quota_manager. An attempt made for random driven generalization in the dispense_equally_test(). The latter also includes a specific value to reproduce #8613.

Also tailgated is a tiny fix for the lower boundary of kafka_throughput_limit_node_out_bps cluster property.

Backports Required

  • none - not a bug fix
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v22.3.x
  • v22.2.x
  • v22.1.x

UX Changes

  • none

Release Notes

  • none

@dlex dlex requested review from dotnwat and graphcareful February 3, 2023 23:04
@dlex dlex marked this pull request as ready for review February 3, 2023 23:05
dlex added 3 commits February 4, 2023 14:39
Some internal namespace functions are exposed via `kafka::detail` ns
specifically for the tests.

Tests include some specific cases and attempt for random driven
generalization in the dispense_equally_test(). The latter also includes
a specific value to reproduce redpanda-data#8613.
The minimum boundary for thoughput limit properties was originally
`ss::smp::count` so that each shard would not get a zero default quota.
Later that was changed to dynamic boundary control, while the static
property minimum was changed to a constant `1` so that there is no
situation when cluter properties replayed from the controller log
were out of property bounds if smp::count on the node is different
from the node where the configuration was made.

However the change for kafka_throughput_limit_node_out_bps was left behind.
@dlex dlex force-pushed the 8613_quota-value-mismatch branch from ea3ba07 to 459505e Compare February 4, 2023 19:39
@dlex
Copy link
Contributor Author

dlex commented Feb 4, 2023

Force push: sample numbers in dispense_negative_deltas_test were not valid, changed them into an at-cap case

@dlex
Copy link
Contributor Author

dlex commented Feb 6, 2023

CI Failure in https://buildkite.com/redpanda/redpanda/builds/22535#01861e0d-fc75-47d6-b63c-49c60f12f7e5:

std::uniform_int_distribution<quota_t> dist(
bottomless_token_bucket::min_quota, bottomless_token_bucket::max_quota);

for (size_t shards_count = 1; shards_count != 65; ++shards_count)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: shards_count < 65

@@ -464,10 +464,10 @@ void dispense_equally(std::vector<quota_t>& target, const quota_t value) {
v += share.quot;
if (share.rem > 0) {
v += 1;
share.quot -= 1;
share.rem -= 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

could we write a unit test for this?

Copy link
Member

Choose a reason for hiding this comment

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

@dlex follow up?

@dotnwat dotnwat merged commit df97ae7 into redpanda-data:dev Feb 7, 2023
@dlex dlex deleted the 8613_quota-value-mismatch branch February 7, 2023 06:15
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.

CI Failure (Expected quota value mismatch) in ThroughputLimitsSnc.test_configuration
3 participants