Comment 4 for bug 1719770

Revision history for this message
Drew Freiberger (afreiberger) wrote : Re: hypervisor stats issue after charm removal if nova-compute service not disabled first

In models.py, both in Mitaka and in master, I've found that the relation between ComputeNode and Service is using the following join in the Service context:

        primaryjoin='and_(Service.host == Instance.host,'
                    'Service.binary == "nova-compute",'
                    'Instance.deleted == 0)',

As in my case, I've redeployed a deleted node as the same hostname (Service.host) this join is relating a deleted ComputeNode.host entry to the non-deleted Service.host entry.

If I look at both my compute_nodes and services tables, it appears they should potentially be joined on the "id" field, rather than the "host" field, at least for this specific query, but this potentially breaks the Service object relation model for other query contexts such as instances running on a hypervisor.