stratisd icon indicating copy to clipboard operation
stratisd copied to clipboard

deal with snapshot recovery

Open trgill opened this issue 7 years ago • 2 comments

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.

trgill avatar Sep 28 '17 14:09 trgill

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?

agrover avatar Nov 01 '17 23:11 agrover

not critical for 1.0

agrover avatar Sep 04 '18 17:09 agrover