heat/heat/tests/engine/service
Zane Bitter 46132999c0 Resolve race in providing deployment data to Swift
While we are careful to ensure there are no race conditions in updating
the software deployment metadata in the Heat database, there was no such
protection in place for the actual update of the metadata provided to
the server via Swift. In legacy Heat, this race could only occur when
software deployments were created from the REST API or from separate
stacks deploying software to the same server, because resources in the
same stack were handled by a single thread making synchronous calls to
create the software deployments. However, with convergence, resources in
the same stack not only can be processed concurrently but will tend to
be synchronised if they have the same dependencies (since they'll be
triggered by consecutive asynchronous RPC messages).

This handles the race by retrying if a concurrent update is detected by
the time the data has been provided to Swift.

Note that this is only guaranteed to result in the latest data being
available on the assumption that a later write to Swift cannot overwrite
an earlier one that has been accepted. This is probably *not* guaranteed
by Swift in the presence of clock skew. Nonetheless, this should
drastically reduce the failure rate.

Similar caveats would probably apply to Zaqar, although Zaqar nominally
provides FIFO queues (in practice, it likely depends on the backend
used). However, with Zaqar clients receive all updates, not just the
latest one, and os-collect-config stores the deployments contained in
every message. Thus, Zaqar is not affected even assuming out-of-order
arrival.

Change-Id: Ic9a447f27e8c51f91f47f93b0fd1e9710341ec38
Closes-Bug: #1731032
2018-03-23 18:17:29 +01:00
..
__init__.py Split engine service test cases (8) 2015-08-20 21:19:59 -04:00
test_service_engine.py Unit tests: Don't leave RPC server running 2017-10-19 18:03:59 -04:00
test_software_config.py Resolve race in providing deployment data to Swift 2018-03-23 18:17:29 +01:00
test_stack_action.py Unit tests: ensure all threads complete 2017-10-19 17:44:33 -04:00
test_stack_adopt.py Unit tests: ensure all threads complete 2017-10-19 17:44:33 -04:00
test_stack_create.py Unit tests: ensure all threads complete 2017-10-19 17:44:33 -04:00
test_stack_delete.py Unit tests: Don't leave RPC server running 2017-10-19 18:03:59 -04:00
test_stack_events.py Unit tests: ensure all threads complete 2017-10-19 17:44:33 -04:00
test_stack_resources.py Move FakeKeystoneClient to engine.clients 2017-10-24 11:45:31 -04:00
test_stack_snapshot.py Unit tests: ensure all threads complete 2017-10-19 17:44:33 -04:00
test_stack_update.py Merge "Rename Resource._resolve_all_attributes() method" 2017-08-14 12:24:13 +00:00
test_threadgroup_mgr.py Use a queue instead of an event to send messages 2016-07-18 16:26:17 -04:00