[watcher] Compute CDM builder issues (mostly perf related)

Matt Riedemann mriedemos at gmail.com
Wed May 15 14:32:34 UTC 2019


On 5/15/2019 4:13 AM, li.canwei2 at zte.com.cn wrote:
> [licanwei]:please refer to 
> <https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L144>https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L144 
> 
> 
> When a nova notification is received before the nova CDM is built or no 
> node in the CDM,
> 
> the node will be add to the CDM.
> 

That's not what's happening in this bug. We're getting an 
instance.update event from nova during scheduling/building of an 
instance before it has a host, so when this is called:

https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L220

node_uuid is None.

Which means we never call get_or_create_node here:

https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L44

And then we blow up here:

https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L50

because self.cluster_data_model is None.

Based on your earlier reply about when the nova CDM is built:

 > [licanwei]:Yes, the CDM will be built when the first audit being created.

It seems the fix for this notification traceback bug is to just make 
sure the self.cluster_data_model is not None and return early if it's 
not, i.e. gracefully handle receiving notifications before we've ever 
done an audit and built the nova CDM.

-- 

Thanks,

Matt



More information about the openstack-discuss mailing list