]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: strengthen is_local_primary() and is_linked()
authorIlya Dryomov <idryomov@gmail.com>
Sat, 18 Jun 2022 10:35:51 +0000 (12:35 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Jun 2022 17:47:18 +0000 (19:47 +0200)
commitc60f1d5813c7fe248593731bbffb43d12cdd3b62
tree8f4e362019ac5053bfdb7996e07ee4fb205aa075
parent3c0ff7fb68b28f9d96076e23b27a32386ac13b8a
rbd-mirror: strengthen is_local_primary() and is_linked()

Initialize local_promotion_state and remote_promotion_state to UNKNOWN
instead of counterintuitive PRIMARY and NON_PRIMARY -- half the time the
final values are flipped.  Then is_local_primary() and is_linked() can
be strengthened as a non-existent image should stay in UNKNOWN.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/tools/rbd_mirror/image_replayer/StateBuilder.cc
src/tools/rbd_mirror/image_replayer/StateBuilder.h