Changes between Initial Version and Version 1 of Ticket #361, comment 11


Ignore:
Timestamp:
04/29/2014 09:25:21 AM (5 years ago)
Author:
trev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #361, comment 11

    initial v1  
    1 For reference, the analysis performed by greiner indicated that truncating a file makes Chrome write all pending changes to disk whereas an actual write operation kept the data in cache and only wrote it to disk at some later point. Our code overwriting a file was originally calling `truncate(0)` and writing the data then - a crash after the write operation would cause the cache with the file data to be lost and the file would stay at zero size. The new code is writing the data first and only truncating the file after that, it no longer seems to suffer from this issue. 
     1For reference, the analysis performed by greiner indicated that truncating a file makes Chrome write all pending changes to disk whereas an actual write operation keeps the data in cache and only writes it to disk at some later point. Our code overwriting a file was originally calling `truncate(0)` and writing the data then - a crash after the write operation would cause the cache with the file data to be lost and the file would stay at zero size. The new code is writing the data first and only truncating the file after that, it no longer seems to suffer from this issue.