Skip to content

[Archive] Skip non-VALID catalog entries in ArchiveTool dump - #2122

Open
d9zbglobal wants to merge 2 commits into
aeron-io:masterfrom
d9zbglobal:archive-tool-dump-skip-non-valid
Open

[Archive] Skip non-VALID catalog entries in ArchiveTool dump#2122
d9zbglobal wants to merge 2 commits into
aeron-io:masterfrom
d9zbglobal:archive-tool-dump-skip-non-valid

Conversation

@d9zbglobal

@d9zbglobal d9zbglobal commented Aug 19, 2026

Copy link
Copy Markdown

Fixes #2100.

ArchiveTool dump handed every catalog entry to a RecordingReader, so the first DELETED/INVALID tombstone (whose segment files are gone) threw IllegalArgumentException: length must be positive and aborted the whole run — valid recordings later in the catalog were never reached. Archives that purge recordings (e.g. snapshot rotation via AeronArchive.purgeRecording) accumulate such tombstones until an offline compact, making dump effectively unusable on them.

This applies the same state() == VALID guard that describe uses to dump's catalog.forEach, so non-valid entries are skipped and the remaining recordings are dumped.

Includes a test (ArchiveToolTests.dumpShouldSkipRecordingsInNonValidStates) covering both a DELETED and an INVALID entry; it fails with the reported exception without the fix.

(@bantek899 — saw your comment on the issue offering to pick this up, apologies for the overlap: we hit this in production tooling and had the change ready. Hope you don't mind.)


Note

Low Risk
Small, read-only change to offline archive inspection tooling; behavior aligns with existing describe filtering and is covered by a focused unit test.

Overview
ArchiveTool dump no longer tries to read segment data for every catalog row. Its catalog.forEach callback now matches describe: it only invokes the per-recording dump when headerDecoder.state() == VALID, so tombstoned DELETED / INVALID entries (often missing segment files) are ignored instead of aborting the whole command.

A new test marks a previously valid recording DELETED, runs dump, and asserts output includes a later VALID recording while omitting the deleted one and catalog INVALID entries.

Reviewed by Cursor Bugbot for commit 49c417e. Bugbot is set up for automated code reviews on this repo. Configure here.

@d9zbglobal
d9zbglobal force-pushed the archive-tool-dump-skip-non-valid branch from 7228d82 to dbbf223 Compare August 19, 2026 15:27
…ED/INVALID tombstones no longer abort the run. Issue aeron-io#2100.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@d9zbglobal
d9zbglobal force-pushed the archive-tool-dump-skip-non-valid branch from dbbf223 to 49c417e Compare August 19, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArchiveTool dump aborts on DELETED/INVALID catalog entries (missing the state filter that describe has)

1 participant