summaryrefslogtreecommitdiff
path: root/ironic/conductor/base_manager.py
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2023-02-03 10:36:50 +1300
committerSteve Baker <sbaker@redhat.com>2023-02-27 11:09:25 +1300
commite54ee2ba4cb818e25c75fcdc69f7ff1dc4956c73 (patch)
tree9213ee99ad5e0fbf5985de4e2076fa7c0298dc83 /ironic/conductor/base_manager.py
parenteb03345006a04677d674aedc84c1af6b5fd29ed6 (diff)
downloadironic-e54ee2ba4cb818e25c75fcdc69f7ff1dc4956c73.tar.gz
Respond to rpc requests on stop until hash ring reset
Currently when a conductor is stopped, the rpc service stops responding to requests as soon as self.manager.del_host returns. This means that until the hash ring is reset on the whole cluster, requests can be sent to a service which is stopped. This change waits for the remaining seconds to delay stopping until CONF.hash_ring_reset_interval has elapsed. This will improve the reliability of the cluster when scaling down or rolling out updates. This delay only occurs when there is more than one online conductor, to allow fast restarts on single-node ironic installs (bifrost, metal3). Change-Id: I643eb34f9605532c5c12dd2a42f4ea67bf3e0b40
Diffstat (limited to 'ironic/conductor/base_manager.py')
-rw-r--r--ironic/conductor/base_manager.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ironic/conductor/base_manager.py b/ironic/conductor/base_manager.py
index 22ebd57f5..5c2e4ea95 100644
--- a/ironic/conductor/base_manager.py
+++ b/ironic/conductor/base_manager.py
@@ -334,6 +334,10 @@ class BaseConductorManager(object):
self._started = False
+ def get_online_conductor_count(self):
+ """Return a count of currently online conductors"""
+ return len(self.dbapi.get_online_conductors())
+
def _register_and_validate_hardware_interfaces(self, hardware_types):
"""Register and validate hardware interfaces for this conductor.