]> 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>
Wed, 22 Jun 2022 12:33:07 +0000 (14:33 +0200)
commit4287d7e651307fe10a7bfaa2c81ca5ac81dbb64e
treeae4b10dc2eee0576afefcfb1de4f3aca3657e174
parentb3641a55c6b9ed8f813eab4ef0cde6337b2b7ee6
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>
(cherry picked from commit c60f1d5813c7fe248593731bbffb43d12cdd3b62)
src/tools/rbd_mirror/image_replayer/StateBuilder.cc
src/tools/rbd_mirror/image_replayer/StateBuilder.h