Closed emersonknapp closed 1 year ago
Added a regression test - verified that test fails without f.seek
change, passes with it.
@jacobperron @mjcarroll @sloretz a review would be much appreciated :) hopefully I have made it easy with the regression test.
This bug is a far corner case, but it's real: someone using a format-compliant parser that is reading records without using the index will find invalid records in the file, even after using the reindex
command which purports to fix the file.
Looks good to me, tests pass.
Fixes #2282
The truncate operation left the current
f.tell()
read head at the pre-truncated position, so the chunk infos that are written on closing the file started writing at this pre-truncated position, leaving dangling broken chunk data in between the last good chunk and the first file-end chunkinfo.