neutron/neutron/db
Slawek Kaplonski 4a45e1adeb Choose random value for HA routes' vr_id
HA routers are using keepalived and needs to have virtual_router_id
configured. As routers which belongs to same tenant are using same
ha network, those values have to be different for each router.

Before this patch this value was always taken as first available value
from available_vr_ids range.
In some (rare) cases, when more than one router is created in parallel
for same tenant it may happen that those routers would have same vr_id
choosen so keepalived would treat them as single application and only
one router would be ACTIVE on one of L3 agents.

This patch changes this behaviour that now random value from available
vr_ids will be chosen instead of taking first value always.
That should mittigate this rare race condition that it will be (almost)
not noticable for users.

However, proper fix should be probably done as some additional
constraint in database layer. But such solution wouldn't be possible to
backport to stable branches so I decided to propose this easy patch
first.

Conflicts:
    neutron/db/l3_hamode_db.py

Change-Id: Idb0ed744e54976dca23593fb2d7317bf77442e65
Related-Bug: #1823314
(cherry picked from commit a8d0f557d5)
(cherry picked from commit ee2ed681c4)
(cherry picked from commit 72c9a7ef84)
2019-04-12 16:04:20 +00:00
..
allowed_address_pairs debtcollector for globals 2016-08-30 10:18:19 -04:00
availability_zone Decompose router extra attr processing 2017-01-12 02:20:58 -08:00
extra_dhcp_opt Switch to 'subquery' for 1-M relationships 2017-02-14 15:27:07 +00:00
metering Merge "DVR: Fix IPtables driver for metering with DVR routers" 2017-01-20 04:08:55 +00:00
migration Tag the alembic migration revisions for Ocata 2017-02-05 16:25:26 +00:00
models Switch to 'subquery' for 1-M relationships 2017-02-14 15:27:07 +00:00
network_dhcp_agent_binding Relocate Agent DB model 2016-10-07 14:18:19 -04:00
port_security Add missing revision number altercations 2016-09-25 02:18:01 -07:00
qos Switch to 'subquery' for 1-M relationships 2017-02-14 15:27:07 +00:00
quota Refactor/prepare db common utils for neutron-lib 2016-10-28 10:53:11 -04:00
__init__.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
_utils.py Refactor/prepare db common utils for neutron-lib 2016-10-28 10:53:11 -04:00
address_scope_db.py Use project_id instead of tenant_id in objects 2017-01-13 14:31:26 +00:00
agents_db.py Stop logging versions on every agent update 2017-08-25 17:37:38 +00:00
agentschedulers_db.py Move AgentStatusCheckWorker to PeriodicWorker 2016-11-17 15:31:19 -08:00
allowedaddresspairs_db.py objects: add delete_objects public method 2016-12-13 17:35:47 +00:00
api.py Register sqlalchemy events through hook for UT cleanup 2017-01-20 04:15:01 -08:00
common_db_mixin.py Add work-around for older oslo.db 2017-04-07 14:52:36 +00:00
db_base_plugin_common.py Add IPAllocations to the port fixed_ips 2017-04-27 17:43:56 +00:00
db_base_plugin_v2.py Allow self-sharing RBAC rules to be deleted without usage check 2017-05-02 15:50:39 -04:00
dns_db.py Add OVO for dns Objects 2016-10-27 17:39:45 +00:00
dvr_mac_db.py Use new enginefacade for dvr mac db 2017-01-13 13:06:06 +00:00
external_net_db.py Merge "Stop using .delete() in external net handling code" 2017-01-10 15:57:50 +00:00
extradhcpopt_db.py Integrate the Extra Dhcp Opt VersionedObject in Neutron 2016-04-07 16:44:33 +01:00
extraroute_db.py Restore extraroute dict after OVO change 2016-12-14 23:50:19 +09:00
flavors_db.py Flavor and Service Profile to OVO 2017-01-05 16:59:36 -06:00
ipam_backend_mixin.py Always pass device_owner to _ipam_get_subnets() 2018-02-17 18:32:21 +00:00
ipam_pluggable_backend.py Fix race between create subnet and port requests 2017-10-03 11:49:28 +02:00
l3_agentschedulers_db.py Revert "Add ALLOCATING state to routers" 2017-01-09 15:56:09 +00:00
l3_attrs_db.py L3: Add in missing translation 2017-01-14 14:40:05 +02:00
l3_db.py Disallow router interface out of subnet IP range 2018-07-20 21:28:28 +00:00
l3_dvr_db.py Fix notification about arp entries for dvr routers 2019-02-18 10:22:19 +01:00
l3_dvr_ha_scheduler_db.py Remove unused LOG 2016-07-05 15:22:13 +08:00
l3_dvrscheduler_db.py Fix typos 2017-01-18 15:48:32 +07:00
l3_gwmode_db.py Relocate L3 DB Models 2016-09-27 16:58:55 +00:00
l3_hamode_db.py Choose random value for HA routes' vr_id 2019-04-12 16:04:20 +00:00
l3_hascheduler_db.py Adopt neutron-lib plugin directory 2016-11-23 04:45:33 -07:00
models_v2.py Avoid loading network and all rels for subnet query 2017-04-27 06:51:12 +00:00
netmtu_db.py Calculate MTU on every network fetch instead of on create 2016-07-20 13:26:50 +02:00
network_ip_availability_db.py IP Availability: remove unused imports 2016-03-01 07:06:10 -08:00
portbindings_base.py Remove @author(s) from copyright statements 2014-09-15 21:40:09 +09:00
portbindings_db.py Relocate PortBindingPort DB Model 2016-09-22 19:35:03 +00:00
portsecurity_db.py Use converters and validators from neutron-lib 2016-04-24 19:13:10 -04:00
portsecurity_db_common.py Refactor/prepare db common utils for neutron-lib 2016-10-28 10:53:11 -04:00
provisioning_blocks.py Integration of Provisioning Block OVO. 2017-02-02 19:16:55 +00:00
quota_db.py Create packages for quota modules 2015-07-28 11:55:01 -07:00
rbac_db_mixin.py Refactor/prepare db common utils for neutron-lib 2016-10-28 10:53:11 -04:00
rbac_db_models.py Use DB field sizes instead of _MAX_LEN constants 2016-12-23 13:48:57 +00:00
securitygroups_db.py Enforce ethertype with IPv6 integer protocols 2017-08-25 12:10:22 +00:00
securitygroups_rpc_base.py Fix security group rules created for dhcpv6 2017-05-30 22:03:14 +00:00
segments_db.py Change passing session to context in segments db functions 2016-12-23 16:47:41 +04:00
servicetype_db.py objects: add delete_objects public method 2016-12-13 17:35:47 +00:00
sqlalchemytypes.py Truncate microseconds before DB insertion 2016-09-01 13:25:24 +00:00
standard_attr.py Register sqlalchemy events through hook for UT cleanup 2017-01-20 04:15:01 -08:00
standardattrdescription_db.py Add common way to extend standard attribute models 2016-09-15 01:42:24 +00:00
subnet_service_type_db_models.py debtcollector for globals 2016-08-30 10:18:19 -04:00
tag_db.py Relocate Tag DB model 2016-10-03 10:20:05 -05:00
vlantransparent_db.py Moving VLAN Transparency support from core to extension 2015-04-08 08:35:13 -07:00