New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0 byte dat file #5460
Comments
stevendanna
added a commit
to stevendanna/habitat
that referenced
this issue
Aug 16, 2018
This adds two calls to fsync in the DatFile write method: 1) On the temporary file before the rename 2) On the parent directory after the rename The first fsync is to persist the content of the dat file to disk. I think this might have prevented of the 0-byte DatFile seen in habitat-sh#5460. The second fsync is to persist the rename operation to disk. I've no-oped it on Windows since we found that calling sync_all on a directory in windows produces an error in b688d8a. Signed-off-by: Steven Danna <steve@chef.io>
stevendanna
added a commit
to stevendanna/habitat
that referenced
this issue
Aug 16, 2018
This adds two calls to fsync in the DatFile write method: 1) On the temporary file before the rename 2) On the parent directory after the rename The first fsync is to persist the content of the dat file to disk. I think this might have prevented of the 0-byte DatFile seen in habitat-sh#5460. The second fsync is to persist the rename operation to disk. I've no-oped it on Windows since we found that calling sync_all on a directory in windows produces an error in b688d8a. Signed-off-by: Steven Danna <steve@chef.io>
Closed by #5461 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We recently had a user report that a Habitat supervisor was failing to start. The supervisor log showed:
Further investigation showed that
/hab/sup/default/data/cab66ba4cf12423db7b6cce2a1d76c54.rst
existed but was a 0-byte file.While we haven't been able to investigate the problem further yet, the code that handles the writes:
habitat/components/butterfly/src/rumor/dat_file.rs
Lines 234 to 267 in 52b8c4e
appears to be missing at least two calls to fsync if we want those writes to be durable. We likely need an fsync on the temporary file before the rename to ensure that the content of the file has been written to disk and an fsync on the enclosing directory after the rename to ensure that the rename operation is flushed to disk.
The text was updated successfully, but these errors were encountered: