Merge "Agent RPC step size in config."

This commit is contained in:
Zuul 2021-09-07 12:33:19 +00:00 committed by Gerrit Code Review
commit 2ed28e4e01
4 changed files with 17 additions and 4 deletions

View File

@ -34,7 +34,6 @@ from oslo_utils import uuidutils
from neutron.agent import resource_cache
from neutron.api.rpc.callbacks import resources
from neutron.common import _constants as n_const
from neutron import objects
LOG = logging.getLogger(__name__)
@ -182,7 +181,7 @@ class PluginApi(object):
ret_devices_down = []
failed_devices_down = []
step = n_const.RPC_RES_PROCESSING_STEP
step = cfg.CONF.rpc_resources_processing_step
devices_up = list(devices_up)
devices_down = list(devices_down)
for i in range(0, max(len(devices_up), len(devices_down)), step):

View File

@ -27,7 +27,6 @@ from oslo_config import cfg
from oslo_log import log as logging
from neutron.agent import firewall
from neutron.common import _constants as common_constants
from neutron.conf.agent import securitygroups_rpc as sc_cfg
@ -155,7 +154,7 @@ class SecurityGroupAgentRpc(object):
@_port_filter_lock
def _apply_port_filter(self, device_ids, update_filter=False):
step = common_constants.AGENT_RES_PROCESSING_STEP
step = cfg.CONF.rpc_resources_processing_step
devices = {}
security_groups = {}
security_group_member_ips = {}

View File

@ -13,6 +13,7 @@
from oslo_config import cfg
from neutron._i18n import _
from neutron.common import _constants
AGENT_OPTS = [
cfg.IntOpt('agent_down_time', default=75,
@ -41,6 +42,12 @@ AGENT_OPTS = [
"enable_new_agents=False. In the case, user's "
"resources will not be scheduled automatically to the "
"agent until admin changes admin_state_up to True.")),
cfg.IntOpt("rpc_resources_processing_step",
default=_constants.RPC_RES_PROCESSING_STEP, min=1,
help=_("Number of resources for neutron to divide "
"the large RPC call data sets. It can be reduced "
"if RPC timeout occurred. The best value can be "
"determined empirically in your environment."))
]

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Introduced config option for RPC agent step size customization:
rpc_resources_processing_step - Number of resources for neutron to divide
the large RPC call data sets. It can be reduced if RPC timeout occurred.
Default value equals 20. The best value can be determined empirically in
your environment.