]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: reset bootstrap state to replaying if local image promoted
authorJason Dillaman <dillaman@redhat.com>
Fri, 20 Dec 2019 03:43:06 +0000 (22:43 -0500)
committerJason Dillaman <dillaman@redhat.com>
Sat, 21 Dec 2019 16:29:18 +0000 (11:29 -0500)
commit8c33391a6294f68b590f26fff190a34a2dc317eb
treec2cd7a17ef404fd219fc98c7b9b1e6e64dd0ed1e
parent53455eebdf82c9c82a78d9b8d8238caea2b8796e
rbd-mirror: reset bootstrap state to replaying if local image promoted

The previous logic had a race in that it would never run if the local
image was force-promoted or if the remote image was demoted and the
local image was promoted before the rbd-mirror daemon could catch the
change of state.

This change resets the mirror peer state from syncing to replaying if
the local image is no longer connected to the remote image. This
prevents an unexpected (and corrupted) re-sync from the remote.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/rbd_mirror/image_replayer/test_mock_BootstrapRequest.cc
src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc
src/tools/rbd_mirror/image_replayer/BootstrapRequest.h