neutron/neutron/db
Slawek Kaplonski 72c9a7ef84 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)
2019-04-12 09:00:49 +02:00
..
allowed_address_pairs Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
availability_zone use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
extra_dhcp_opt Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
metering Use Router OVO in metering_db 2018-01-16 09:50:57 +07:00
migration Update neutron files for new over-indentation hacking rule (E117) 2019-02-02 10:48:26 +00:00
models use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
network_dhcp_agent_binding OVO for NetworkDhcpAgentBinding 2017-09-08 15:48:00 +00:00
port_security Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
qos [L3][QoS] Neutron server side Floating IP QoS 2017-11-29 16:45:38 +08:00
quota [trivial fix]fix typos in neutron 2017-12-31 06:43:52 +00:00
__init__.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
_model_query.py Reorder checks in apply_filters in db/_model_query 2017-11-01 09:44:26 +09:00
_resource_extend.py Refactor CommonDbMixin for removal 2017-04-25 14:13:30 -04:00
_utils.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
address_scope_db.py use neutron-lib address scope apidef 2017-09-20 10:58:12 -06:00
agents_db.py Make port binding attempt after agent is revived 2018-10-23 11:00:50 +02:00
agentschedulers_db.py use agent api def from neutron-lib 2017-11-21 12:22:53 -07:00
allowedaddresspairs_db.py use addr pairs api def from lib 2017-11-13 11:56:32 -07:00
api.py Cleaned up get_session 2018-01-05 18:39:19 +00:00
common_db_mixin.py Move _get_marker_obj() out of CommonDbMixin. 2017-05-02 16:47:42 +00:00
data_plane_status_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
db_base_plugin_common.py Switch to Subnet OVO in ipam_backend_mixin _save_subnet method 2018-01-03 12:48:44 +01:00
db_base_plugin_v2.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
dns_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
dvr_mac_db.py use dvr api def from neutron-lib 2017-11-13 10:27:16 -07:00
external_net_db.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
extradhcpopt_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
extraroute_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
flavors_db.py use flavors api def from neutron-lib 2017-11-17 10:21:28 -07:00
ipam_backend_mixin.py Always pass device_owner to _ipam_get_subnets() 2018-02-17 18:31:50 +00:00
ipam_pluggable_backend.py Fix port update deferred IP allocation with host_id + new MAC 2019-02-13 02:09:08 +00:00
l3_agentschedulers_db.py Handle AgentNotFoundByTypeHost exception properly 2018-04-13 07:11:18 +00:00
l3_attrs_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_db.py Check port VNIC type when associating a floating IP 2019-01-18 18:24:31 +01:00
l3_dvr_db.py Fix notification about arp entries for dvr routers 2019-02-15 16:03:41 +00:00
l3_dvr_ha_scheduler_db.py Fix connection between 2 dvr routers 2018-11-14 20:48:56 +00:00
l3_dvrscheduler_db.py Merge "DVR: Centralized FloatingIPs are not cleared after migration." into stable/queens 2018-11-20 03:29:35 +00:00
l3_fip_qos.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
l3_gwmode_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_hamode_db.py Choose random value for HA routes' vr_id 2019-04-12 09:00:49 +02:00
l3_hascheduler_db.py use service type constants from neutron_lib plugins 2017-06-27 15:16:05 -06:00
models_v2.py Allow to set/modify network mtu 2017-08-11 00:57:34 +00:00
network_ip_availability_db.py Add network ip availability filtered by project_id 2017-08-23 08:53:25 +08:00
portbindings_base.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portbindings_db.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
portsecurity_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portsecurity_db_common.py use neutron-lib port security api-def 2017-05-01 11:45:42 -06:00
provisioning_blocks.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
quota_db.py Create packages for quota modules 2015-07-28 11:55:01 -07:00
rbac_db_mixin.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
rbac_db_models.py Bump network rev on RBAC change 2017-08-02 16:44:01 +00:00
securitygroups_db.py Fix regression with SG read API with empty ruleset 2019-04-10 05:51:27 +00:00
securitygroups_rpc_base.py remove neutron.callbacks package 2018-01-16 09:32:32 -07:00
segments_db.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
servicetype_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
sqlalchemytypes.py For typo in sqlalchemytypes 2017-02-13 16:18:46 +00:00
standard_attr.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
standardattrdescription_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
subnet_service_type_db_models.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
tag_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
vlantransparent_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00