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: fixes for book keeping of dirty and closed bytes #25076

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

WillemKauf
Copy link
Contributor

There were a number of bugs in the disk_log_impl dirty and closed bytes book-keeping that are fixed by this PR:

  1. Some calls to subtract_dirty_segment_bytes which did not check if the segment in question was already cleanly compacted. This would leave to over-deduction of dirty bytes.
  2. In do_compact_adjacent_segments(), it is possible to merge a cleanly compacted segment with a non-cleanly compacted segment. Later on, when this replacement segment is finally marked cleanly compacted, the sum of bytes (including those that have already been removed when the cleanly compacted segment was marked) will once again be deducted. We must add these back and consider them as "dirty" to avoid this over-deduction.
  3. Also in do_compact_adjacent_segments(), a call to remove_segment_permanently() for one of the segments being merged would remove its dirty and closed bytes. These bytes are still present in the replacement segment and should not be removed.
  4. Finally, in rewrite_segment_with_offset_map(), we would again over-deduct dirty bytes for a segment that was already marked as cleanly compacted.

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

Release Notes

  • none

No functional changes in this PR, just a new accessor function.
There were a number of bugs in the book-keeping that are fixed by
this commit:

1. Some calls to `subtract_dirty_segment_bytes` which did not check
   if the segment in question was already cleanly compacted. This
   would leave to over-deduction of dirty bytes.
2. In `do_compact_adjacent_segments()`, it is possible to merge
   a cleanly compacted segment with a non-cleanly compacted segment.
   Later on, when this replacement segment is finally marked cleanly
   compacted, the sum of bytes (including those that have already been
   removed when the cleanly compacted segment was marked) will once
   again be deducted. We must add these back and consider them as
   "dirty" to avoid this over-deduction.
3. Also in `do_compact_adjacent_segments()`, a call to
   `remove_segment_permanently()` for one of the segments being merged
   would remove its dirty and closed bytes. These bytes are still
   present in the replacement segment and should not be removed.
4. Finally, in `rewrite_segment_with_offset_map()`, we would again
   over-deduct dirty bytes for a segment that was already marked as
   cleanly compacted.
@vbotbuildovich
Copy link
Collaborator

CI test results

test results on build#61806
test_id test_kind job_url test_status passed
rptest.tests.datalake.compaction_test.CompactionGapsTest.test_translation_no_gaps.cloud_storage_type=CloudStorageType.S3.catalog_type=CatalogType.REST_HADOOP ducktape https://buildkite.com/redpanda/redpanda/builds/61806#0194f760-a7a1-4466-b888-e765d2454312 FLAKY 1/2
rptest.tests.e2e_shadow_indexing_test.ShadowIndexingWhileBusyTest.test_create_or_delete_topics_while_busy.short_retention=True.cloud_storage_type=CloudStorageType.ABS ducktape https://buildkite.com/redpanda/redpanda/builds/61806#0194f760-a7a1-4466-b888-e765d2454312 FLAKY 1/2
rptest.transactions.producers_api_test.ProducersAdminAPITest.test_producers_state_api_during_load ducktape https://buildkite.com/redpanda/redpanda/builds/61806#0194f773-2fb8-4b10-be0c-7c7dedf56454 FLAKY 1/2

@WillemKauf
Copy link
Contributor Author

/ci-repeat 1
skip-build
skip-units
dt-repeat=50
tests/rptest/tests/log_compaction_test.py

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.

2 participants