LongListDisk.writeLongsData() may corrupt data in snapshots #18235
Labels
Bug
An error that causes the feature to behave differently than what was expected based on design.
Platform Data Structures
Platform Virtual Map
Platform
Tickets pertaining to the platform
Milestone
LongListDisk.writeLongsData()
reads all current chunks from its backing file and writes them to the target file in logical order (from min to max index value).Chunk file offsets are allocate dynamically and the last logical chunk (with largest index values) may be allocated in the middle of the backing file. Similarly, the last physical chunk may be in the middle of the index value range.
The last physical chunk may be truncated because the backing file is enlarged according to the actual data written to it (see
LongListDisk.putToChunk()
) and if the largest index value in that chunk is less thanmemoryChunkSize
the chunk is effectively truncated: when such chunk is read intotransferBuffer
the number of bytes actually read is less than the limit of the buffer and the remaining part of the buffer is left unchanged, possibly containing data from the previous logical chunk. The entire buffer with the wrong data is then written into the target file (that was actually observed in #18136).The text was updated successfully, but these errors were encountered: