Steps to reproduce:
$ rbd --cluster site-b mirror group promote test_pool/test_group --force
$ rbd --cluster site-a mirror group demote test_pool/test_group
$ rbd --cluster site-a mirror group resync test_pool/test_group
$ rbd --cluster site-b mirror group status test_pool/test_group
The group snapshots are are not re-syncing. And the group status shows image
snap as syncing always.
fixes: issue#11
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
if (r < 0 && r != -ENOENT) {
derr << "failed reading metadata: " << cpp_strerror(r) << dendl;
} else if (r == 0) {
+ dout(10) << "local group resync requested" << dendl;
*m_resync_requested = true;
}
}
}
auto prev_remote_snap_ns = std::get_if<cls::rbd::GroupSnapshotNamespaceMirror>(
&prev_remote_snap->snapshot_namespace);
- if (prev_remote_snap_ns && prev_remote_snap_ns->is_demoted()) {
+ if (prev_remote_snap_ns &&
+ (prev_remote_snap_ns->state != cls::rbd::MIRROR_SNAPSHOT_STATE_PRIMARY ||
+ prev_remote_snap_ns->state != cls::rbd::MIRROR_SNAPSHOT_STATE_PRIMARY_DEMOTED)) {
break;
}
}