Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ANA group id in local namespace list #895

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading