]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: defend for primary as part of disable request
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Fri, 28 Feb 2025 19:44:17 +0000 (01:14 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:31 +0000 (21:26 +0530)
commita47c933e0cb43d5cc0ebf61cb7002472db10c025
tree56d647c28487973aecda207733fa1a96fab9bbe3
parent92be83a03aef619b87c63397ccc74ff421a4db41
librbd: defend for primary as part of disable request

Other wise we will procceed with disable in below case and end-up not
able to promote the same later:

[root@dhcp53-181 build]#  ./bin/rbd --cluster site-a mirror group demote test_pool/test_group --debug-rbd=0
Group demoted to non-primary
[root@dhcp53-181 build]# ./bin/rbd --cluster site-a mirror group disable test_pool/test_group --debug-rbd=0
2025-03-01T00:46:55.214+0530 7f1cdd71a6c0 -1 librbd::mirror::DisableRequest: 0x56213d4b8f10 handle_get_mirror_info: mirrored image is not primary, add force option to disable mirroring
2025-03-01T00:46:55.215+0530 7f1ce4c39b80 -1 librbd::api::Mirror: image_disable: cannot disable mirroring: (22) Invalid argument
2025-03-01T00:46:55.218+0530 7f1ce4c39b80 -1 librbd::api::Mirror: group_disable: failed to disable mirroring on image: test_image1(22) Invalid argument
2025-03-01T00:46:55.238+0530 7f1cddf1b6c0 -1 librbd::mirror::DisableRequest: 0x56213d17d790 handle_get_mirror_info: mirrored image is not primary, add force option to disable mirroring
2025-03-01T00:46:55.238+0530 7f1ce4c39b80 -1 librbd::api::Mirror: image_disable: cannot disable mirroring: (22) Invalid argument
2025-03-01T00:46:55.241+0530 7f1ce4c39b80 -1 librbd::api::Mirror: group_disable: failed to disable mirroring on image: test_image2(22) Invalid argument
2025-03-01T00:46:55.265+0530 7f1cdd71a6c0 -1 librbd::mirror::DisableRequest: 0x56213d52f290 handle_get_mirror_info: mirrored image is not primary, add force option to disable mirroring
2025-03-01T00:46:55.265+0530 7f1ce4c39b80 -1 librbd::api::Mirror: image_disable: cannot disable mirroring: (22) Invalid argument
2025-03-01T00:46:55.269+0530 7f1ce4c39b80 -1 librbd::api::Mirror: group_disable: failed to disable mirroring on image: test_image3(22) Invalid argument
2025-03-01T00:46:55.293+0530 7f1cddf1b6c0 -1 librbd::mirror::DisableRequest: 0x56213d544620 handle_get_mirror_info: mirrored image is not primary, add force option to disable mirroring
2025-03-01T00:46:55.293+0530 7f1ce4c39b80 -1 librbd::api::Mirror: image_disable: cannot disable mirroring: (22) Invalid argument
2025-03-01T00:46:55.297+0530 7f1ce4c39b80 -1 librbd::api::Mirror: group_disable: failed to disable mirroring on image: test_image4(22) Invalid argument
2025-03-01T00:46:55.316+0530 7f1ce4c39b80 -1 librbd::api::Mirror: group_disable: failed to disable one or more images: (22) Invalid argument
[root@dhcp53-181 build]#  ./bin/rbd --cluster site-a mirror group promote test_pool/test_group --debug-rbd=0
rbd: mirroring not enabled on the group

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
src/librbd/api/Mirror.cc