I think it's pretty clear at this point that the issue is we stopped checking the instance_group.hosts in the ServerGroupAntiAffinityFilter:
group_hosts = (spec_obj.instance_group.hosts if spec_obj.instance_group else []) LOG.debug("Group anti affinity: check if %(host)s not " "in %(configured)s", {'host': host_state.host, 'configured': group_hosts})
if group_hosts:
return host_state.host not in group_hosts
And we are now relying on this:
# The list of instances UUIDs on the given host
instances = set(host_state.instances.keys())
Which doesn't get set within the same request when we call HostState.consume_from_request, and that introduces the race.
I think it's pretty clear at this point that the issue is we stopped checking the instance_ group.hosts in the ServerGroupAnti AffinityFilter:
group_hosts = (spec_obj. instance_ group.hosts
if spec_obj. instance_ group else [])
LOG.debug( "Group anti affinity: check if %(host)s not "
"in %(configured)s", {'host': host_state.host,
'configure d': group_hosts})
if group_hosts:
return host_state.host not in group_hosts
And we are now relying on this:
# The list of instances UUIDs on the given host state.instances .keys() )
instances = set(host_
Which doesn't get set within the same request when we call HostState. consume_ from_request, and that introduces the race.