stratisd
stratisd copied to clipboard
Make static header updates more robust
trafficstars
Related to #3035 Related to https://github.com/stratis-storage/project/issues/50
We should handle some sort of failure recovery when the static header (previously unchangeable) changes due to the underlying device size changing like in the RAID case. In these situations, it is possible for the first header write to succeed and the second header write to fail, leaving the headers in "correct" (according to the CRC) but disagreeing states
Potential options:
- Rollback using temporary files and back up functionality
- Rollback using an in-memory solution to cache the old header and try to restore it if the second write fails
- Special case set up
- Use some of our unused static header space to add in a "last updated" field; this is likely the most generalized (and potentially correct) solution, particularly if we add more fields to the static header that are able to change
Currently, I think we're tending towards extending the static header with a timestamp of "last updated".
We should potentially put this in the same release as #3274