From 2df5690a67c21e4a48fa0072f706493a011b0191 Mon Sep 17 00:00:00 2001 From: Gil Bregman Date: Sun, 13 Oct 2024 21:40:53 +0300 Subject: [PATCH] Update ANA group is in local namespace list. Fixes #894 Signed-off-by: Gil Bregman --- control/grpc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/control/grpc.py b/control/grpc.py index 91fdd9efb..6b82dd9fc 100644 --- a/control/grpc.py +++ b/control/grpc.py @@ -148,6 +148,9 @@ def is_host_in_namespace(self, host_nqn): def host_count(self): return len(self.host_list) + def set_ana_group_id(self, anagrpid): + self.anagrpid = anagrpid + class NamespacesLocalList: EMPTY_NAMESPACE = NamespaceInfo(None, None, None, 0, False) @@ -1421,6 +1424,8 @@ def namespace_change_load_balancing_group_safe(self, request, context): self.logger.error(errmsg) return pb2.req_status(status=errno.ENODEV, error_message=errmsg) + find_ret = self.subsystem_nsid_bdev_and_uuid.find_namespace(request.subsystem_nqn, nsid) + omap_lock = self.omap_lock.get_omap_lock_to_use(context) with omap_lock: ns_entry = None @@ -1453,6 +1458,8 @@ def namespace_change_load_balancing_group_safe(self, request, context): transit_anagrpid=0 ) self.logger.debug(f"nvmf_subsystem_set_ns_ana_group: {ret}") + if not find_ret.empty(): + find_ret.set_ana_group_id(request.anagrpid) except Exception as ex: errmsg = f"{change_lb_group_failure_prefix}:\n{ex}" resp = self.parse_json_exeption(ex)