neutron/neutron/tests/unit/services
Bence Romsics 10191fd817 Retry trunk status updates failing with StaleDataError
This is an approximate partial fix to #1828375.

update_trunk_status and update_subport_bindings rpc messages are
processed concurrently and possibly out of order on the server side.
Therefore they may race with each other.

The status update race combined with
1) the versioning feature of sqlalchemy used in the standardattributes
   table and
2) the less than serializable isolation level of some DB backends (like
   MySQL InnoDB)
does raise StaleDataErrors and by that leaves some trunk subports in
DOWN status.

This change retries the trunk status update (to BUILD) blindly when
StaleDataError was caught. In my local testbed this practically
fixes #1828375.

However theoretically the retry may cover up other real errors (when the
cause of the StaleDataError was a different status not just a different
revision count).

To the best of my understanding a proper fix would entail guaranteeing
the in order processing of the above rpc messages - which likely won't
ever happen.

I'm not sure at all if this change is worth merging - let me know what
you think.

Conflicts:
    neutron/services/trunk/rpc/server.py
    neutron/tests/unit/services/trunk/rpc/test_server.py

Change-Id: Ie581809f24f9547b55a87423dac7db933862d66a
Partial-Bug: #1828375
(cherry picked from commit 618e24e241)
(cherry picked from commit d090fb9a3c)
2019-07-31 07:24:46 +00:00
..
auto_allocate OVO External Networks 2017-03-07 20:03:30 +00:00
l3_router Fix attribute mismatch in router provider update 2019-04-18 20:57:20 +08:00
logapi ovs fw: apply the NORMAL action on egress traffic in a single table 2018-09-07 10:11:38 +07:00
metering test_metering_plugin: convert from Agent model to OVO 2017-12-11 16:45:34 +07:00
qos use callback payloads for PRECOMMIT_UPDATE events 2018-07-20 08:30:29 +00:00
revisions Specify tenant_id in TestRevisionPlugin objects 2019-04-05 11:05:06 +00:00
trunk Retry trunk status updates failing with StaleDataError 2019-07-31 07:24:46 +00:00
__init__.py Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
test_provider_configuration.py use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00