Images cannot be moved to trash if the state is disabling because its a
transient state where some of the images might have got the oportunity to
disable and some of them part of the group might still be enabled
waiting for the oportunity while a group disable is in progress.
So we wait until the state DISABLING moves to next state, and see if there are
any stale image to move into a trash queue later.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
<< dendl;
m_local_images.insert({spec.pool_id, mirror_image.global_image_id});
} else {
+ if (m_local_mirror_group.state == cls::rbd::MIRROR_GROUP_STATE_DISABLING) {
+ dout(10) << "local group with global_group_id: " << m_local_mirror_group.global_group_id
+ << " is in disabling state, will retry later." << dendl;
+ finish(-ERESTART);
+ return;
+ }
+
dout(10) << "add to trash queue: " << spec.pool_id << " "
<< spec.image_id << " " << mirror_image.global_image_id
<< dendl;