rebalance handles degraded namespaces #1961
Not a big deal, but in this case it's better to return EINVAL and not ENODEV.
Not a big deal, but better use GatewayService.MAINTENANCE_ANA_GROUP this is defined per class and not per specific instance.
You should use "anagrp" in an info message as it is visible to users. It should be "load balancing group" or something similar.
A few minor comments
@gbregman ,
class Rebalance:
def __init__(self, gateway_service):
self.logger = gateway_service.logger
self.gw_srv = gateway_service
self.ceph_utils = gateway_service.ceph_utils
self.ana_grp_location = {} # fill location of each ana grp for responses of monitor
self.rebalance_period_sec = gateway_service.config.getint_with_default(
"gateway",
"rebalance_period_sec",
7)
self.degraded_group = gateway_service.MAINTENANCE_ANA_GROUP <== it is the same constant
rebalance gets this gatewayservice as a parameter
I tried to import .grpc but there is a cyclic dependeny
@gbregman , ok , but currently rebalance uses anagrp for the load balancing group, I can change this is separate commit
@gbregman , thanks , will do
You can use whatever you want internally but you shouldn't display it to the user. Better ask Aviv which is the proper term to use in "info" messages.
This is why I moved some constants to GatewayUtils. But it's not that important.
gbregman
leonidc
No description provided by author.