Commit 740ae2c9 authored by David Johnson's avatar David Johnson

Manually handle a couple data deps in SimpleElasticSliceManager.

should_add_nodes and should_delete_nodes require that we have certain
pieces of status and availability data... so make sure we do.

(Of course this doesn't handle the case of data stale-ness yet...)
parent d98a80cb
......@@ -1522,6 +1522,13 @@ class SimpleElasticSliceManager(ElasticSliceManager,
LOG.debug("should_add_nodes: cm=%s" % (str(cm)))
if not 'ntotal' in self.aggdata[cm]:
self.update_all()
pass
if not 'status' in self.aggdata[cm]['status']:
self.update_sliver_status()
pass
#
# See if we need to add more nodes to get to our threshold; if
# so, see if any are available, and add a few if so. Otherwise
......@@ -1607,6 +1614,13 @@ class SimpleElasticSliceManager(ElasticSliceManager,
LOG.debug("cm=%s currently adding, not deleting" % (cm,))
return False
if not 'ntotal' in self.aggdata[cm]:
self.update_all()
pass
if not 'status' in self.aggdata[cm]['status']:
self.update_sliver_status()
pass
if self.enable_delete and len(self.aggdata[cm]['adding']) == 0 \
and self.aggdata[cm]['status']['status'] == 'ready' \
and len(self.aggdata[cm]['node_map']) > self.minthreshold \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment