Parallelize periodic power sync calls follow up

Fixes quite a few assorted nits. Follows up Change-Id
I80297c877d9a87d3bd8fc30d0ed65cd443f200b3

Change-Id: I92faffb4fac349a77e3597f3668c75bbc2c2397d
This commit is contained in:
Ilya Etingof 2019-01-23 11:03:35 +01:00
parent 7448603ab8
commit 821d5fef73
3 changed files with 11 additions and 12 deletions

View File

@ -1642,12 +1642,12 @@ class ConductorManager(base_manager.BaseConductorManager):
for node_info in self.iter_nodes(fields=['id'], filters=filters):
nodes.put(node_info)
number_of_threads = min(CONF.conductor.sync_power_state_workers,
number_of_workers = min(CONF.conductor.sync_power_state_workers,
CONF.conductor.periodic_max_workers,
nodes.qsize())
futures = []
for thread_number in range(max(0, number_of_threads - 1)):
for worker_number in range(max(0, number_of_workers - 1)):
try:
futures.append(
self._spawn_worker(self._sync_power_state_nodes_task,
@ -1656,7 +1656,7 @@ class ConductorManager(base_manager.BaseConductorManager):
LOG.warning("There are no more conductor workers for "
"power sync task. %(workers)d workers have "
"been already spawned.",
{'workers': thread_number})
{'workers': worker_number})
break
try:

View File

@ -78,9 +78,9 @@ opts = [
'in DB')),
cfg.IntOpt('sync_power_state_workers',
default=8, min=1,
help=_('The maximum number of workers that can be started '
'simultaneously to sync nodes power state from the '
'periodic task.')),
help=_('The maximum number of worker threads that can be '
'started simultaneously to sync nodes power states from '
'the periodic task.')),
cfg.IntOpt('periodic_max_workers',
default=8,
help=_('Maximum number of worker threads that can be started '

View File

@ -1,9 +1,8 @@
---
features:
- |
Parallelizes periodic power sync calls by running up to
``sync_power_state_workers`` simultenously. The default is to run
up to ``8`` workers.
This change should let larger-scale setups to run power syncs more
frequently and make the whole power sync procedure more resilient to slow
or dead BMCs.
Parallelizes periodic power sync calls by running up to ironic
configuration ``[conductor]/sync_power_state_workers`` simultaneously.
The default is to run up to ``8`` workers. This change should let
larger-scale setups running power syncs more frequently and make the whole
power sync procedure more resilient to slow or dead BMCs.