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

cst/cache: fix in mem trim termination condition #21606

Merged

Conversation

abhijat
Copy link
Contributor

@abhijat abhijat commented Jul 24, 2024

At the end of an in-memory trim if the size to delete is equal to or less than undeletable bytes the trim should finish, because further trimming will not result in extra space being freed up. The undeletable bytes are from the access tracker size.

In particular where tracker is not yet saved to disk, the size to delete and undeletable bytes can both be zero and the existing 0 < 0 check fails, resulting in an expensive disk based walk being wasted as the subsequent trim runs with 0 size to delete.

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.2.x
  • v24.1.x
  • v23.3.x

Release Notes

  • none

At the end of an in-memory trim if the size to delete is equal to or
less than undeletable bytes the trim should finish, because further
trimming will not result in extra space being freed up.
@abhijat abhijat force-pushed the issue/fix-in-mem-trim-termination-condition branch from 98209a9 to 1fe047d Compare July 24, 2024 08:55
@abhijat abhijat requested review from Lazin and jcipar July 24, 2024 10:54
@abhijat abhijat merged commit 970e9ce into redpanda-data:dev Jul 24, 2024
19 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.2.x

@vbotbuildovich
Copy link
Collaborator

/backport v24.1.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.

3 participants