Issue I:
As part of the remove_local_mirror_group if local mirror group global_group_id
doesn't match with GroupReplayer instance (m_global_group_id), then
remove_local_group()
In a case where the daemon is down then group is disabled then removed/added
images then re-enabled groups and then brought the daemon back to life,
the Groupreplayer instances belonging to same group name will mess
leading to path of create_local_mirror_group(), which is wrong.
Issue II:
Also, in cases where local mirror group global_group_id doesn't match with
GroupReplayer instance, if there are ENOENT errors in the bootstrapping
then retry the bootstrapping.
With out this fix, this will lead to group_replayer destroy of a valid instance.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
}
m_local_mirror_group.state = cls::rbd::MIRROR_GROUP_STATE_DISABLED;
- if (r != -ENOENT && (m_remote_mirror_group.state == cls::rbd::MIRROR_GROUP_STATE_ENABLED &&
+ if (r != -ENOENT && (m_local_mirror_group.global_group_id == m_global_group_id) &&
+ (m_remote_mirror_group.state == cls::rbd::MIRROR_GROUP_STATE_ENABLED &&
m_remote_mirror_group_primary)) {
create_local_mirror_group();
} else {
}
}
+ if (r == -ENOENT && m_local_mirror_group.global_group_id != m_global_group_id) {
+ r = -ERESTART; // try again
+ }
+
m_on_finish->complete(r);
}