after a lot of testing and digging around the BTRFS man pages i need help from some Linux / BTRFS folks.
I have a java application that writes data files to disk using the java MappedByteBuffer utility. This is application uses a byte buffer of ~16000 bytes when writing to disk. When a new file is being written to it creates a temp file of the buffer size and due to the java implementation of mem-mapped files the code does not explicitly close the file. Instead we call Linux's drop_caches to force unused memory maps to flush to disk.
- On EXT4 these files are automatically closed and the filesize is adjusted correctly.
- On BTRFS these files stay the ~16000 bytes and are missing some data (possibly paging issues)
- On BTRFS when i delete these files and the software re-runs and creates the files again the same issue occurs each time AND the modified dates are from when the files were originally created
Server info: We are running on the latest centos 7.2 and are up to date with patches
- OS Centos 7 x64 (Kernel 3.10.0-514.10.2.el7.x86_64)
- btrfs-progs v4.4.1
- Java 1.8.0_111
Testing performed
We have a replica server running on Ext4 and this issue is not happening
We are currently using COW and compression so i tried disabling them both, rebooting, deleting the old data and restarting the software. The issue still occurred
- I have also tried disabling space_cache, recovery and i also tried setting commit=5 with flushoncommit ...this also didnt help the non closing files / the incorrect modified dates