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

tests: fix test_changing_topic_retention_with_restart #5331

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented Jul 4, 2022

Cover letter

This test was assuming that segment sizes apply exactly,
but they are actually subject to a +/- 5% jitter. To reliably
remove the expected number of segments, we must set our retention
bytes to 5% less than the amount we really expect to retain.

Fixes #2406

Release notes

  • none

@jcsp jcsp force-pushed the issue-2406-retention-policy-test branch from a2c0ab3 to f35e164 Compare July 4, 2022 10:58
@jcsp jcsp marked this pull request as ready for review July 4, 2022 11:00
Copy link
Contributor

@VladLazar VladLazar left a comment

Choose a reason for hiding this comment

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

This looks fine to me. I'll leave it to someone with more in depth knowledge of the tests to approve though. Is the 5% jitter something that you figured out empirically?

@jcsp
Copy link
Contributor Author

jcsp commented Jul 4, 2022

Is the 5% jitter something that you figured out empirically?

Nope, it's this constant in the source:

static constexpr jitter_percents default_segment_size_jitter(5);

While I was updating this I added a reference to the comment in the test.

This test was assuming that segment sizes apply exactly,
but they are actually subject to a +/- 5% jitter.  To reliably
remove the expected number of segments, we must set our retention
bytes to 5% less than the amount we really expect to retain.

Fixes redpanda-data#2406
@jcsp jcsp force-pushed the issue-2406-retention-policy-test branch from f35e164 to 20949e3 Compare July 4, 2022 15:15
Copy link
Member

@BenPope BenPope left a comment

Choose a reason for hiding this comment

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

LGTM

@jcsp
Copy link
Contributor Author

jcsp commented Jul 4, 2022

@jcsp jcsp merged commit 7d372ff into redpanda-data:dev Jul 4, 2022
@jcsp jcsp deleted the issue-2406-retention-policy-test branch July 4, 2022 19:21
@BenPope
Copy link
Member

BenPope commented Jul 25, 2022

@jcsp looks like this will backport to v22.1.x, v21.11.x

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.

Failure in RetentionPolicyTest.test_changing_topic_retention_with_restart
5 participants