From: Jason Dillaman Date: Thu, 7 Nov 2019 19:51:50 +0000 (-0500) Subject: Merge pull request #30821 from dillaman/wip-41972-nautilus X-Git-Tag: v14.2.5~143 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=963b2939e180b574bf6901244a3dfd86d533e50c;p=ceph.git Merge pull request #30821 from dillaman/wip-41972-nautilus nautilus: rbd-mirror: simplify peer bootstrapping Reviewed-by: Mykola Golub --- 963b2939e180b574bf6901244a3dfd86d533e50c diff --cc src/include/rbd_types.h index 4401a36c8ba9,7f5e32688afe..35a1a8bc3c3b --- a/src/include/rbd_types.h +++ b/src/include/rbd_types.h @@@ -116,10 -116,13 +116,13 @@@ * MON config-key prefix for storing optional remote cluster connectivity * parameters */ - #define RBD_MIRROR_PEER_CONFIG_KEY_PREFIX "rbd/mirror/peer/" + #define RBD_MIRROR_CONFIG_KEY_PREFIX "rbd/mirror/" + #define RBD_MIRROR_SITE_NAME_CONFIG_KEY RBD_MIRROR_CONFIG_KEY_PREFIX "site_name" + #define RBD_MIRROR_PEER_CLIENT_ID_CONFIG_KEY RBD_MIRROR_CONFIG_KEY_PREFIX "peer_client_id" + #define RBD_MIRROR_PEER_CONFIG_KEY_PREFIX RBD_MIRROR_CONFIG_KEY_PREFIX "peer/" struct rbd_info { - __le64 max_id; + ceph_le64 max_id; } __attribute__ ((packed)); struct rbd_obj_snap_ondisk { diff --cc src/mon/MonCap.cc index 8e8382337400,e011d5514135..a0e91c3614b9 --- a/src/mon/MonCap.cc +++ b/src/mon/MonCap.cc @@@ -310,11 -308,16 +311,19 @@@ void MonCapGrant::expand_profile_mon(co StringConstraint constraint(StringConstraint::MATCH_TYPE_PREFIX, "rbd/mirror/"); profile_grants.push_back(MonCapGrant("config-key get", "key", constraint)); + } else if (profile == "rbd-mirror-peer") { + StringConstraint constraint(StringConstraint::MATCH_TYPE_REGEX, + "rbd/mirror/[^/]+"); + profile_grants.push_back(MonCapGrant("config-key get", "key", constraint)); + + constraint = StringConstraint(StringConstraint::MATCH_TYPE_PREFIX, + "rbd/mirror/peer/"); + profile_grants.push_back(MonCapGrant("config-key set", "key", constraint)); } - + else if (profile == "crash") { + // TODO: we could limit this to getting the monmap and mgrmap... + profile_grants.push_back(MonCapGrant("mon", MON_CAP_R)); + } if (profile == "role-definer") { // grants ALL caps to the auth subsystem, read-only on the // monitor subsystem and nothing else.