host_state_map was added to scheduler for the purpose of caching latest
host_state in memory for scheduler. With this cache, scheduler has the
latest host_state (e.g. free_capacity, allocated_capacity, etc) of hosts
even hosts haven't reported their updated status to scheduler.
Unfortunately, this cache is flushed when scheduling pulling all available
volume services from DB in current implementation, which is a bug.
This change remove the host_state_map.clear() so that scheduler is able to
maintain an up-to-date (well, mostly) view of all volume services in memory.
Also, added code to remove non-active host from the cache every time when
scheduler handles a new request. Multi-line docstrings in cinder/scheduler/
host_manager.py are also fixed.
Reviewed: https:/ /review. openstack. org/76734 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=be340fbd74e 0778e04c6e96210 947cdb9379fdef
Committed: https:/
Submitter: Jenkins
Branch: master
commit be340fbd74e0778 e04c6e96210947c db9379fdef
Author: Zhiteng Huang <email address hidden>
Date: Thu Feb 27 09:58:17 2014 +0800
Don't clear host_state_map when scheduling
host_state_map was added to scheduler for the purpose of caching latest
host_state in memory for scheduler. With this cache, scheduler has the
latest host_state (e.g. free_capacity, allocated_capacity, etc) of hosts
even hosts haven't reported their updated status to scheduler.
Unfortunately, this cache is flushed when scheduling pulling all available
volume services from DB in current implementation, which is a bug.
This change remove the host_state_ map.clear( ) so that scheduler is able to
maintain an up-to-date (well, mostly) view of all volume services in memory.
Also, added code to remove non-active host from the cache every time when
scheduler handles a new request. Multi-line docstrings in cinder/scheduler/
host_manager.py are also fixed.
Change-Id: Ib47be483fa2663 1a1483721e2ae6d 972994e150f
Fixes-bug: 1271162