stratisd
stratisd copied to clipboard
deal with snapshot recovery
How do we recover the allocated space if we get a crash after a snapshot is taken, but before the stratis metadata for the snapshot is saved.
some ideas:
if metadata is written before operation is attempted, a crash will leave the thindev uncreated (but we think it exists):
- journal changes & replay on restart
If metadata is written after operation is attempted, a crash will result in an allocated thindev we don't know about:
- periodically just try to delete all thin_ids not in use (there's only 2^24)
- Use a repeatable algorithm for allocating thin_ids. Knowing which one is next means if we try to use it later and it fails, we know it was leaked (citation needed?) and we can clean up and then try again. Or, just always try to delete next thin_id on every startup. (Assumes we only ever leak a single thin_id.)
Thoughts? Other ideas?
not critical for 1.0