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

Sylvain Bauza sylvain.bauza at gmail.com
Mon Mar 17 23:01:48 UTC 2014


Hi Chris,




2014-03-17 23:08 GMT+01:00 Chris Friesen <chris.friesen at windriver.com>:

> On 03/17/2014 02:30 PM, Sylvain Bauza wrote:
>
>> There is a global concern here about how an holistic scheduler can
>> perform decisions, and from which key metrics.
>> The current effort is leading to having the Gantt DB updated thanks to
>> resource tracker for scheduling appropriately the hosts.
>>
>> If we consider these metrics as not enough, ie. that Gantt should
>> perform an active check to another project, that's something which needs
>> to be considered carefully. IMHO, on that case, Gantt should only access
>> metrics thanks to the project REST API (and python client) in order to
>> make sure that rolling upgrades could happen.
>> tl;dr: If Gantt requires accessing Nova data, it should request Nova
>> REST API, and not perform database access directly (even thru the
>> conductor)
>>
>
> Consider the case in point.
>
> 1) We create a server group with anti-affinity policy.  (So no two
> instances in the group should run on the same compute node.)
> 2) We boot a server in this group.
> 3) Either simultaneously (on a different scheduler) or immediately after
> (on the same scheduler) we boot another server in the same group.
>
> Ideally the scheduler should enforce the policy without any races.
> However, in the current code we don't update the instance entry in the
> database with the chosen host until we actually try and create it on the
> host.  Because of this we can end up putting both of them on the same
> compute node.
>
>
There are 2 distinct cases :
1. there are multiple schedulers involved in the decision
2. there is one single scheduler but there is a race condition on it

About 1., I agree we need to see how the scheduler (and later on Gantt)
could address decision-making based on distributed engines. At least, I
consider the no-db scheduler blueprint responsible for using memcache
instead of a relational DB could help some of these issues, as memcached
can be distributed efficiently.

About 2., that's a concurrency issue which can be addressed thanks to
common practices for synchronizing actions. IMHO, a local lock can be
enough for ensuring isolation



> Currently we only detect the problem when we go to actually boot the
> instance on the compute node because we have a special-case check to
> validate the policy.  Personally I think this is sort of a hack and it
> would be better to detect the problem within the scheduler itself.
>
> This is something that the scheduler should reasonably consider.  I see it
> as effectively consuming resources, except that in this case the resource
> is "the set of compute nodes not used by servers in the server group".
>
>
>
Agree. IMHO, scheduler could take decisions based on inputs and should
guarantee the result. That said, at the moment, we need to address the
issue at the compute manager level, because of the point above.

-Sylvain


> Chris
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140318/1c18e2c3/attachment.html>


More information about the OpenStack-dev mailing list