neutron/neutron/tests/unit/db
venkata anil c06ff65dbb l2pop fdb flows for HA router ports
This patch makes L3 HA failover not depended on neutron components
(during failover).

All HA agents(active and backup) call update_device_up/down after wiring
the ports. But l2pop driver is called for only active agent as port
binding in DB reflects active agent. Then l2pop creates unicast and
multicast flows for active agent.
On failover, flows to new active agent is created. For this to happen -
all of database, messaging server, neutron-server and destination L3
agent should be active during failover. This creates two issues -
1) When any of the above resources(i.e neutron-server, .. ) are dead,
   flows between new master and other agents won't be created and
   L3 Ha failover is not working. In same scenario, L3 Ha failover will
   work if l2pop is disabled.
2) Packet loss during failover is higher as above neutron resources
   interact multiple times, so will take time to create l2 flows.

In this change, we allow plugin to notify l2pop when update_device_up/down
is called by backup agents also. Then l2pop will create flood flows to
all HA agents(both active and slave). L2pop won't create unicast flow for
this port, instead unicast flow is created by learning action of table 10
when keepalived sends GARP after assigning ip address to master router's
qr-xx port. As flood flows are already created and unicast flow is
dynamically added, L3 HA failover is not depended on l2pop.

This solves two isses
1) with L3 HA + l2pop, failover will work even if any of above agents
   or processes dead.
2) Reduce failover time as we are not depending on neutron to create
   flows during failover.
We use L3HARouterAgentPortBinding table for getting all HA agents of a
router port. HA router port on slave agent is also considered for l2pop
distributed_active_network_ports and agent_network_active_port_count

Conflicts:
        neutron/db/l3_hamode_db.py
        neutron/plugins/ml2/drivers/l2pop/db.py
        neutron/plugins/ml2/drivers/l2pop/mech_driver.py
        neutron/plugins/ml2/rpc.py
        neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py
        neutron/tests/unit/plugins/ml2/drivers/l2pop/test_mech_driver.py
        neutron/tests/unit/plugins/ml2/test_rpc.py

Closes-bug: #1522980
Closes-bug: #1602614
Change-Id: Ie1f5289390b3ff3f7f3ed7ffc8f6a8258ee8662e
(cherry picked from commit 26d8702b9d)
2016-10-12 12:32:22 +00:00
..
metering COMMON_PREFIXES cleanup - patch 1/5 2015-07-02 17:05:27 -07:00
quota Scope get_tenant_quotas by tenant_id 2016-01-13 14:56:18 +00:00
__init__.py Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
test_agents_db.py Refactor the rpc callback version discovery mechanism 2016-06-09 13:43:08 +00:00
test_agentschedulers_db.py Not auto schedule router when sync routers from agent 2016-07-12 11:04:43 +00:00
test_allowedaddresspairs_db.py Merge "Allow address pairs to be cleared with None" 2016-02-26 21:33:23 +00:00
test_api.py Check for StaleData errors in retry decorator 2016-09-21 09:48:15 +02:00
test_bgp_db.py Fixes KeyError while updating bgp peer 2016-09-19 11:53:15 +05:30
test_bgp_dragentscheduler_db.py BGP Dynamic Routing: introduce BgpDrScheduler model 2016-02-12 14:17:57 +05:30
test_common_db_mixin.py L3HA: Do not wrap create/delete in transaction 2016-03-11 23:59:10 +00:00
test_db_base_plugin_common.py Replace to_dict() calls with a function decorator 2015-08-03 11:42:25 +03:00
test_db_base_plugin_v2.py Insert validation with request params for HTTP DELETE 2016-05-26 17:51:33 +00:00
test_dvr_mac_db.py Clear DVR MAC on last agent deletion from host 2016-04-16 07:00:51 +00:00
test_ipam_backend_mixin.py Allow auto-addressed ips deletion on port update 2016-08-16 16:40:37 +03:00
test_ipam_non_pluggable_backend.py Move tests for non pluggable ipam backend 2015-08-19 13:09:02 +03:00
test_ipam_pluggable_backend.py Always call ipam driver on subnet update 2016-05-26 14:03:03 +00:00
test_l3_db.py l3: Send notify on router_create when ext gw is specified 2016-03-29 15:13:32 +00:00
test_l3_dvr_db.py Fix misuse of assertTrue in L3 DVR test case 2016-07-25 22:19:55 +00:00
test_l3_hamode_db.py l2pop fdb flows for HA router ports 2016-10-12 12:32:22 +00:00
test_migration.py neutron-db-manage: revision: fail for --autogenerate and branch 2016-05-26 18:07:03 +00:00
test_portsecurity_db.py port security: gracefully handle resources with no bindings 2016-03-30 17:15:56 +00:00
test_portsecurity_db_common.py port security: gracefully handle resources with no bindings 2016-03-30 17:15:56 +00:00
test_securitygroups_db.py add PROTO_NUM_IPV6_ICMP for _validate_port_range 2016-06-16 16:02:17 +02:00
test_sqlalchemytypes.py Add custom SQLAlchemy type for MACAddress 2016-03-15 17:31:55 +01:00