[openstack-dev] [nova] question about e41fb84 "fix anti-affinity race condition on boot"

Chris Friesen chris.friesen at windriver.com
Sat Mar 15 18:39:02 UTC 2014


Hi,

I'm curious why the specified git commit chose to fix the anti-affinity 
race condition by aborting the boot and triggering a reschedule.

It seems to me that it would have been more elegant for the scheduler to 
do a database transaction that would atomically check that the chosen 
host was not already part of the group, and then add the instance (with 
the chosen host) to the group.  If the check fails then the scheduler 
could update the group_hosts list and reschedule.  This would prevent 
the race condition in the first place rather than detecting it later and 
trying to work around it.

This would require setting the "host" field in the instance at the time 
of scheduling rather than the time of instance creation, but that seems 
like it should work okay.  Maybe I'm missing something though...

Thanks,
Chris



More information about the OpenStack-dev mailing list