Skip to content

Commit

Permalink
Pass all clusters of GW when call bdev_rbd_wait_for_latest_osdmap RPC
Browse files Browse the repository at this point in the history
Signed-off-by: Leonid Chernin <[email protected]>
  • Loading branch information
Leonid Chernin committed Oct 31, 2024
1 parent 00b63ed commit 0ffcf99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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 in self.clusters:
for cluster in self.clusters[grp_id]:
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=}")
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand Down

0 comments on commit 0ffcf99

Please sign in to comment.