From 8c35de397e6a6c3e9282a4d890c03fa92844a94c Mon Sep 17 00:00:00 2001 From: Leonid Chernin Date: Thu, 31 Oct 2024 06:32:56 +0000 Subject: [PATCH] Pass all clusters of GW when call bdev_rbd_wait_for_latest_osdmap RPC Signed-off-by: Leonid Chernin --- control/grpc.py | 13 +++++++++---- docker-compose.yaml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/control/grpc.py b/control/grpc.py index 5d7b0b46..801e9337 100644 --- a/control/grpc.py +++ b/control/grpc.py @@ -1195,6 +1195,7 @@ def set_ana_state_safe(self, ana_info: pb2.ana_info, context=None): state = self.gateway_state.local.get_state() inaccessible_ana_groups = {} optimized_ana_groups = set() + wait_osdmap_rpc_performed = False # Iterate over nqn_ana_states in ana_info for nas in ana_info.states: @@ -1224,10 +1225,14 @@ def set_ana_state_safe(self, ana_info: pb2.ana_info, context=None): # part of bocklist logic if gs.state == pb2.ana_state.OPTIMIZED: if grp_id not in optimized_ana_groups: - for cluster in self.clusters[grp_id]: - if not rpc_bdev.bdev_rbd_wait_for_latest_osdmap(self.spdk_rpc_client, name=cluster): - raise Exception(f"bdev_rbd_wait_for_latest_osdmap({cluster=}) error") - self.logger.debug(f"set_ana_state bdev_rbd_wait_for_latest_osdmap {cluster=}") + if wait_osdmap_rpc_performed == False: #perfored RPC calls to all clusters of the gateway + #for cluster in self.clusters: + for grp_id_it in self.clusters: + for cluster in self.clusters[grp_id_it]: + self.logger.debug(f"set_ana_state bdev_rbd_wait_for_latest_osdmap {cluster=}") + if not rpc_bdev.bdev_rbd_wait_for_latest_osdmap(self.spdk_rpc_client, name=cluster): + raise Exception(f"bdev_rbd_wait_for_latest_osdmap({cluster=}) error") + wait_osdmap_rpc_performed = True optimized_ana_groups.add(grp_id) self.logger.debug(f"set_ana_state nvmf_subsystem_listener_set_ana_state {nqn=} {listener=} {ana_state=} {grp_id=}") diff --git a/docker-compose.yaml b/docker-compose.yaml index f480d7fa..3876bc58 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -66,7 +66,7 @@ services: environment: TOUCHFILE: /tmp/ceph.touch entrypoint: >- - sh -c './vstart.sh --new $$CEPH_VSTART_ARGS && + sh -c './vstart.sh --without-dashboard --new $$CEPH_VSTART_ARGS && echo ceph dashboard nvmeof-gateway-add -i <(echo nvmeof-devel:5500) nvmeof.1 && pushd /etc/ceph && openssl req -x509 -newkey rsa:4096 -nodes -keyout server.key -out server.crt -days 3650 -subj /CN=my.server -addext "subjectAltName = IP:192.168.13.3, IP:0.0.0.0" &&