An update to rmid's persistent state may fail, due to an I/O problem for
example, when either rmid writes a log record or rmid records a snapshot of its
current transient state. If this happens, the update should not be reflected
in the transient state (which currently happens because the transient state is
updated before the log record is written), since this update will be present in
the next snapshot even if writing the log record failed.
Instead, rmid could write the log record first and then only make the update
to the transient state if the log update succeeds. It is important that
the snapshot is taken before the log record is written because if it happens
in the reverse (log record written before snapshot), the transient update
will not be present in the snapshot (because it happens afterward) and the log
record will be discarded along with the snapshot, losing any information of the
update.