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

storage: various space management non-functional changes #18314

Merged

Conversation

andrwng
Copy link
Contributor

@andrwng andrwng commented May 8, 2024

Refactors and renames some methods, and tweaks comments and logs to clarify the space management and retention code.

There are no major functional changes in this PR.

Backports Required

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

Release Notes

  • none

I found the name a bit vague in trying to understand what this code was
doing. This updates it to lowest_ts_to_retain(), and updates the
disk_space_manager to use it rather than duplicating the logic.
target_excess -> adjusted_target_excess: I find the name more intuitive,
despite being more verbose at call sites, as a reader I prefer the
reminder that the value has been tweaked
I found the existing logging a bit confusing because "tiered storage
retention" isn't widely used verbiage. This tweaks it to refer to this
as "space management of tiered storage topics".

Also s/recover/remove: it feels a bit clearer, segment removal isn't
referred to as "recovering" in other contexts.
The previous name is pretty vague: as a reader it's unclear what it's
actually doing other than modifying the config in some way.

Updates it to explicitly mention that it is handling local storage
overrides. IMO this is easier to reason about when reading the method
and its call sites.
Similar to maybe_override_retention_config(), updates
override_retention_config() to be called
apply_local_storage_overrides().
Renames apply_base_overrides() to apply_kafka_retention_overrides().
I think it's a bit easier to infer what the Kafka retention overrides
are (i.e. the ones that are Kafka compatible: retention.ms,
retention.bytes).

Others considered but not taken:
- total_retention
- full_retention
- consumable_retention
- topic_retention
Pulls out a couple instances of duplicate code, in an effort to clarify
naming of various overrides and adjustments done around retention.
nvartolomei
nvartolomei previously approved these changes May 10, 2024
src/v/storage/disk_log_impl.cc Show resolved Hide resolved
With the original code, it was easy to get tripped up by the nots and
ors. Tweaks the implementation and adds a comment to make this easier to
read.

No functional changes.
Copy link
Contributor Author

@andrwng andrwng left a comment

Choose a reason for hiding this comment

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

Latest push I added one more commit to bump a message to info level and tweak some other info logging

src/v/storage/disk_log_impl.cc Show resolved Hide resolved
src/v/storage/disk_log_impl.cc Show resolved Hide resolved
@andrwng andrwng requested a review from nvartolomei May 10, 2024 15:40
nvartolomei
nvartolomei previously approved these changes May 10, 2024
Copy link
Contributor

@nvartolomei nvartolomei left a comment

Choose a reason for hiding this comment

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

lgtm!

src/v/resource_mgmt/storage.cc Show resolved Hide resolved
We have seen issues where the lack of tiered storage resulted in disk
filling up. The info logs didn't make it clear what was happening and
it was assumed to be a bug in code, rather than a misconfiguration
issue. This commit bumps a log line to info level so that it would have
been clear that a specific error path wasn't being taken.

Also tweaks wording to makes a stronger connection to tiered storage.
Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

excellent set of changes. thanks for improving!

@andrwng
Copy link
Contributor Author

andrwng commented May 10, 2024

CI failure: #13275

@piyushredpanda piyushredpanda merged commit 0f45388 into redpanda-data:dev May 11, 2024
14 of 17 checks passed
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.

5 participants