-
Notifications
You must be signed in to change notification settings - Fork 580
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
storage: apply limits to segment.bytes #6492
Conversation
03a40fb
to
422463c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also validate this while setting topic properties in AlterConfiguration
?
The thinking behind the silent clamping is:
For self-hosted I think explicitly validating inputs would be fine (they can always change the limit if they don't like it), but in the cloud these limits can't be changed by the user. We could always add the input validation later on top of this change if needed. |
This makes sense to me. |
422463c
to
8d5ef56
Compare
Force pushed to fix the new test (it wasn't clearing the properties at end of test, which caused other tests to misbehave) Twiddling global configs in tests is a bit ugly, but these configs don't belong in the per-log config object. When we do #6431, these should probably move into |
8d5ef56
to
c8ef7ac
Compare
The test needed updating again because I wasn't taking account of segment size jitter (nothing is ever simple!) This is the second time that jitter has bitten me when trying to write a test, so I've also made a small refactor to disable jitter in the storage unit tests by default. |
...and disable it in unit tests. This is not a user facing change. For users they still get the 5% default: it's only in unit tests that we disable it to enable deterministic tests.
To avoid introducing incompatibilities with applications that have existing segment.bytes settings during topic creation, we do not refuse topic creations/alterations that violate these limits. Instead, we accept the user input, but clamp it when applying the segment size limit, so that the effective segment size remains within the bounds even if the apparent segment.bytes property violates it. Fixes: redpanda-data#6036
c8ef7ac
to
82dfdac
Compare
Cover letter
To avoid introducing incompatibilities with applications that have existing segment.bytes settings during topic creation, we do not refuse topic creations/alterations that violate these limits. Instead, we accept the user input, but clamp it when applying the segment size limit, so that the effective segment size remains within the bounds even if the apparent segment.bytes property violates it.
Fixes: #6036
Backport Required
UX changes
See release notes.
Release notes
Features
segment.bytes
topic property. Iflog_segment_size_min
and/orlog_segment_size_max
are set, then anysegment.bytes
outside these bounds will be silently clamped to the permitted range. This prevents poorly-chosen configurations from inducing the cluster to create very large numbers of small segment files, or extremely large segment files.