Skip to content

Commit

Permalink
Merge pull request #895 from gbregman/devel
Browse files Browse the repository at this point in the history
Update ANA group is in local namespace list
  • Loading branch information
gbregman authored Oct 14, 2024
2 parents 737082f + ecb2b01 commit 4bab6db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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, request.nsid)

omap_lock = self.omap_lock.get_omap_lock_to_use(context)
with omap_lock:
ns_entry = None
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4bab6db

Please sign in to comment.