neutron/neutron/tests/unit
venkata anil 385ac553e3 Call update_all_ha_network_port_statuses on agent start
As explained in bug [1] when l3 agent fails to report state to the
server, its state is set to AGENT_REVIVED, triggering
fetch_and_sync_all_routers, which will set all its HA network ports
to DOWN, resulting in
1) ovs agent rewiring these ports and setting status to ACTIVE
2) when these ports are active, server sends router update to l3 agent
As server, ovs and l3 agents are busy with this processing, l3 agent
may fail again reporting state, repeating this process.

As l3 agent is repeatedly processing same routers, SIGHUPs are
frequently sent to keepalived, resulting in multiple masters.

To fix this, we call update_all_ha_network_port_statuses in l3 agent
start instead of calling from fetch_and_sync_all_routers.

[1] https://bugs.launchpad.net/neutron/+bug/1731595/comments/7
Conflicts:
	neutron/agent/l3/agent.py
        neutron/api/rpc/handlers/l3_rpc.py

Note: This RPC update_all_ha_network_port_statuses is added in only pike
and later branches. In older branches, we were using get_router_ids RPC
to invoke _update_ha_network_port_status. As we need to invoke this
functionality during l3 agent start and get_service_plugin_list() is the
only available RPC which is called during l3 agent start, we call
_update_ha_network_port_status from get_service_plugin_list.

Change-Id: Ia9d5549f7d53b538c9c9f93fe6aa71ffff15524a
Related-bug: #1597461
Closes-Bug: #1731595
(cherry picked from commit 9ab1ad1433)
(cherry picked from commit a6d985bbca)
2017-12-06 07:53:06 +00:00
..
agent Merge "Move check_ha_state_for_router() into notification code" into stable/ocata 2017-11-13 20:59:38 +00:00
api Stop making IP-specific provider rules in SG code 2017-04-13 19:54:02 +00:00
callbacks Reduce the number of debug traces emitted by registry callbacks 2016-09-07 20:10:16 -07:00
cmd Ignore gre devices in namespaces when cleaning up devices 2017-06-14 16:19:14 +00:00
common Fixes import_modules_recursively for Windows 2017-08-25 18:05:39 +00:00
core_extensions Adopt neutron-lib plugin directory 2016-11-23 04:45:33 -07:00
db Call update_all_ha_network_port_statuses on agent start 2017-12-06 07:53:06 +00:00
debug Change external_network_bridge default to '' 2016-08-02 11:35:47 -07:00
extensions Do not defer allocation if fixed-ips is in the port create request. 2017-09-01 10:10:36 +00:00
hacking Merge "Replace assertEqual(None, *) with assertIsNone in tests" 2016-11-22 02:15:19 +00:00
ipam OVO for Ipam(Allocation,Subnet,Pool) 2017-01-19 19:25:01 +00:00
notifiers Turn nova notifier into a proper rate limiter 2017-03-20 20:48:58 +00:00
objects Make QoS policy object compatible with versions 1.2 and higher 2017-06-15 19:43:28 +00:00
plugins Fix port deletion when dns_integration is enabled 2017-11-06 11:12:33 +00:00
quota Stop using legacy facade 2017-01-19 13:02:33 +04:00
scheduler Avoid redundant HA port creation during migration 2017-09-11 19:57:01 +00:00
services Fix the wrong usage of new style class in metering 2017-11-01 06:28:29 +00:00
tests Remove recursion from import_modules_recursively 2016-09-30 21:48:50 +00:00
__init__.py Avoid eventlet monkey patching for the tempest plugin 2016-04-29 22:47:24 -05:00
_test_extension_portbindings.py Adopt neutron-lib plugin directory 2016-11-23 04:45:33 -07:00
dummy_plugin.py Adopt neutron-lib plugin directory 2016-11-23 04:45:33 -07:00
extension_stubs.py Use ExtensionDescriptor from neutron-lib 2016-12-02 14:16:06 -05:00
test_auth.py Fix params order in assertEqual 2016-01-13 18:24:04 +05:30
test_context.py Stop using legacy facade 2017-01-19 13:02:33 +04:00
test_manager.py neutron-lib: use CORE from neutron lib constants 2016-12-26 00:56:42 -08:00
test_opts.py Fix the sriov agent config group name 2016-05-05 16:16:08 +08:00
test_policy.py Neutron server was not compatible with member actions 2017-06-19 10:32:48 +02:00
test_service.py Fix that api_workers=0 doesn't spawn any api workers 2016-07-29 05:40:05 -04:00
test_worker.py Move AgentStatusCheckWorker to PeriodicWorker 2016-11-17 15:31:19 -08:00
test_wsgi.py Get rid of get_engine() in db/api.py 2016-08-12 15:48:17 +03:00
testlib_api.py Merge "Stop using legacy facade" 2017-01-20 08:23:22 +00:00