]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: fix mirror image status summary in a namespace
authorIlya Dryomov <idryomov@gmail.com>
Tue, 11 Feb 2025 16:44:51 +0000 (17:44 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 12 Feb 2025 11:38:49 +0000 (12:38 +0100)
commitf5eadfff807a84ff6561da3239ee804e735d64b0
tree870d21b78ad648b25adc36e3d84e2e5290ab6c2e
parentb0ef526071112487e167395b11c0816a07cc0ef5
librbd: fix mirror image status summary in a namespace

For the purposes of the summary with image counts, "rbd mirror pool
status" command is supposed to count each image only once.  To this
end, for unidirectional mirroring the status of the receiving site
should be taken while for bidirectional mirroring the statuses should
be combined/reduced.  For example, if mirroring is enabled on a single
image and everything is in order, the summary is expected to be

  image health: OK
  images: 1 total
      1 replaying

on both clusters even though on the primary the local status is
MIRROR_IMAGE_STATUS_STATE_STOPPED and only on the secondary it's
MIRROR_IMAGE_STATUS_STATE_REPLAYING.

Currently this isn't the case for custom namespaces.  In the same
scenario the primary ends up reporting

  image health: OK
  images: 1 total
      1 stopped

based solely on the local status in a namespace.

Fixes: https://tracker.ceph.com/issues/69911
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
qa/workunits/rbd/rbd_mirror_bootstrap.sh
qa/workunits/rbd/rbd_mirror_helpers.sh
src/librbd/api/Mirror.cc