-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Filesystem API, Live Restore
-
Storage Engines
-
5
-
StorEng - Defined Pipeline
Using truncate to increase a files size will create a hole in the newly allocated space.
We set the hole list correctly when this operation is applied, but if we close and reopen the file we need to regenerate the hole list using lseek.
This will create a hole in the truncate-allocated space which will tell unionFS to read that data from the source directory.
We need to investigate if positive truncates are used in WiredTiger and do one of two things:
- Add an assert to __union_fs_file_truncate that truncate only reduces the file length
- Add logic on file_open that compares the length of the source and destination files. If the destination is longer than the source, remove the range (source_file_end -> dest_file_end) from the hole list.