storage: Orphaned local segments not removed in all situations
Version & Environment
dev
What went wrong?
It's been observed that there may be orphaned segments left behind in tests that delete data and inject failures link to relevant CI report. The failure must occur the moment the segment is being deleted. On restart, redpanda will not attempt to reclaim these orphaned segments.
There has been previous work to removed orphaned segments however this only accounts for data that is deleted via controller commands that would eventually invoke delete_partition at the cluster level. Logs are truncated outside of these contexts, retention being one example.
What should have happened instead?
There should be no discrepancy between what files redpanda thinks are on disk and what actually are on disk.
How to reproduce the issue?
Crash a node while it is deleting a segment
This issue hasn't seen activity in 3 months. If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in two weeks.
This issue was closed due to lack of activity. Feel free to reopen if it's still relevant.