Scheduler: Introduce lightwieght transactional model for HostState

Registered by Nikola ─Éipanov

Nova FilterScheduler implementation even though inherently multi-threaded, uses
no locking for access to the shared in-memory HostState data structures, that
are shared between all active threads. Even though this means that most of
decisions that scheduler makes under load are not internally consistent, this
is not necessarily a huge issue for the basic use case, as Nova makes sure that
the set resource usage policy is maintained even due to races using the retry
mechanism. This can however cause issues in several more complex use cases.
A non exhaustive list of some examples would be: high resource utilization,
high load, specific types of host and resources (e.g. Ironic nodes and
complex resources such as NUMA topology or PCI devices).

We propose to change the scheduler code to use a lightweight transactional
approach to avoid full blown locking while still mitigating some of the race

Blueprint information

John Garbutt
Nikola ─Éipanov
Needs approval
Pending Approval
Series goal:
Needs Code Review
Milestone target:
Started by
John Garbutt

Related branches



Gerrit topic:,topic:bp/host-state-level-locking,n,z

Addressed by:
    Scheduler Introduce lightwieght transactional model for HostState

Please note this blueprint will delayed until the M release if it is not in the NeedsCodeReview state (with all the code up for review) before July 16th, and merged by July 30th. We expect to re-open master for the M release in September. For more information, please see: and
--johnthetubaguy 15th July 2015

Unapproved for liberty due to the Non-Priority Feature Proposal Freeze. --johnthetubaguy 16th July 2015

Addressed by:
    Add lock to scheduler host state updating

Addressed by:
    Add lock to host-state consumption

Addressed by:
    Claim cpu ram and disk in scheduler host state

Addressed by:
    Handle claim failure in FilterScheduler._schedule

Addressed by:
    Claim numa topology in scheduler host state

Addressed by:
    Claim pci in scheduler host state

Addressed by:
    Remove the horrible catch-all during consumption

Addressed by:
    Scheduler use Claim to check resource consumption

Addressed by:
    Refactor claim code to eliminate duplication

Addressed by:
    Correct MoveClaim in getting pci requests

We have to hit Feature Freeze today, please resubmit this for Newton. --johnthetubaguy 3rd March 2016

This looks more or less stalled/abandoned and we're nearly at non-priority feature freeze (6/30) so I'm going to defer this from Newton. -- mriedem 20160629


Work Items

This blueprint contains Public information 
Everyone can see this information.