Ensure that an error in set_metadata does not cause the memory and disk
data to diverge