neutron/neutron/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 use callback payloads for PRECOMMIT_UPDATE events 2018-07-20 08:30:29 +00:00
externaldns use dns api def from neutron-lib 2017-10-20 16:38:33 -06:00
flavors use plugin constants from neutron-lib 2017-10-16 09:32:20 -06:00
l3_router Fix attribute mismatch in router provider update 2019-04-18 20:57:20 +08:00
logapi Merge "Fix no packet log data when debug is set False in configuration" into stable/queens 2018-09-07 22:39:57 +00:00
loki Consume ServicePluginBase from neutron-lib 2017-03-17 12:06:57 -06:00
metering Merge "Update metering driver to load interface driver" into stable/queens 2018-08-29 22:07:14 +00:00
network_ip_availability Fix file permissions 2017-05-31 20:49:01 +00:00
qos Fix QoS rule update 2019-03-29 09:10:09 +00:00
rbac Neutron RBAC API and network support 2015-08-20 20:00:17 -07:00
revisions Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
segments Only store segmenthostmapping when enable segment plugin 2019-05-30 17:56:17 +03:00
tag use neutron-lib's OVO exceptions 2017-08-28 09:31:19 -06:00
timestamp Make code follow log translation guideline 2017-08-14 02:01:48 +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
provider_configuration.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
service_base.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00