Skip to content

Commit

Permalink
dont validate change load balancing group existance if no context
Browse files Browse the repository at this point in the history
Signed-off-by: Leonid Chernin <[email protected]>
  • Loading branch information
leonidc committed Jan 15, 2025
1 parent cd46539 commit 9b5a6c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,12 +1203,14 @@ def namespace_change_load_balancing_group_safe(self, request, context):
self.logger.error(errmsg)
return pb2.req_status(status=errno.ENODEV, error_message=errmsg)

grps_list = self.ceph_utils.get_number_created_gateways(self.gateway_pool, self.gateway_group)
if request.anagrpid not in grps_list:
self.logger.debug(f"ANA groups: {grps_list}")
errmsg = f"{change_lb_group_failure_prefix}: Load balancing group {request.anagrpid} doesn't exist"
self.logger.error(errmsg)
return pb2.req_status(status=errno.ENODEV, error_message=errmsg)
# below checks are legal only if command is initiated by local cli or is sent from the local rebalance logic.
if context:
grps_list = self.ceph_utils.get_number_created_gateways(self.gateway_pool, self.gateway_group)
if request.anagrpid not in grps_list:
self.logger.debug(f"ANA groups: {grps_list}")
errmsg = f"{change_lb_group_failure_prefix}: Load balancing group {request.anagrpid} doesn't exist"
self.logger.error(errmsg)
return pb2.req_status(status=errno.ENODEV, error_message=errmsg)

omap_lock = self.omap_lock.get_omap_lock_to_use(context)
with omap_lock:
Expand Down

0 comments on commit 9b5a6c5

Please sign in to comment.