test(partitions): reproduce purge offset directory sync failure - #4130
Draft
diegomrsantos wants to merge 2 commits into
Draft
diegomrsantos wants to merge 2 commits into
diegomrsantos wants to merge 2 commits into
Conversation
Purge records its applied generation even when synchronizing consumer offset deletions fails, which can suppress cleanup during recovery. Add deterministic failures for both offset directories and a successful control. Verify the real unlinks and the generation recovered from disk. The failure regressions remain red until the purge completion path is fixed. Refs apache#4128.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4130 +/- ##
============================================
- Coverage 87.47% 87.47% -0.01%
Complexity 1575 1575
============================================
Files 1280 1280
Lines 223241 223230 -11
Branches 186604 186593 -11
============================================
- Hits 195290 195273 -17
- Misses 23241 23250 +9
+ Partials 4710 4707 -3
🚀 New features to boost your workflow:
|
This was referenced Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purge can return success and record its applied generation after syncing a consumer offset directory fails. A later power loss can restore the deleted offset files while the completion marker survives, leaving old consumer progress with no purge retry pending.
Refs #4128.
This draft adds regression tests against
masterate0027506f2a0379ee3bb5508427ff570e3a9a435. It contains no production fix.The tests call the real
purge()method and inject a sync failure for each offset directory separately. The fixture persists progress for an individual consumer and a consumer group, records generation4, then requests generation5. It checks that the fault was reached and the offset files were deleted, then reloads the applied generation into a fresh partition.Both failure cases expect purge to return an error and leave generation
4in memory and on disk. Instead, purge returns success and both generations advance to5. A third test allows both directory syncs to succeed and confirms generation5is recorded.The two failure tests intentionally remain red until the bug is fixed. This PR reloads only the generation marker. It does not simulate power loss, restore deleted offset files, reload consumer progress, check
Next, or test retries with fresh writes. The fixture writes durable offset files but does not run both consumer offset durability policies. The simulator coverage proposed in the issue discussion would cover those remaining cases.Run the focused reproduction with
cargo test -p partitions purge_offset_directory_sync_tests -- --nocaptureThe original macOS run produced one passing control and two expected failures. CI also reproduces the group directory failure. Formatting, dependency ordering, Clippy, and TOML checks pass in CI.