Compacting by data follows record headers through the .dat, so one corrupt
header ended the scan: the compaction failed, or, when the header's size
jumped past the end, every record after it was dropped. Compacting by index
copies past such a record.
When the scan stops on a corrupt header or jumps past live records, resume
it at each live record the index places further on. A read error still
fails the compaction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>