reserveSnap() could set certain attributes of rbdSnap, but can fail later on. In case of a failure, attributes set in rbdSnap may not be consistent. The function should cleanup its state in case of a failure (UndoReserveName()), and only change rbdSnap attributes on success.
reserveSnap()
could set certain attributes ofrbdSnap
, but can fail later on. In case of a failure, attributes set inrbdSnap
may not be consistent. The function should cleanup its state in case of a failure (UndoReserveName()
), and only change rbdSnap attributes on success.https://github.com/ceph/ceph-csi/blob/d5849a4801fa9f3383cefc4f96e18fcad420dc80/internal/rbd/rbd_journal.go#L403-L421
_Originally posted by @iPraveenParihar in https://github.com/ceph/ceph-csi/pull/4502#discussion_r1814796388_