From c19b9d8ad6f3574f7b6657db52a5782b28e8739d Mon Sep 17 00:00:00 2001 From: Miguel Lavalle Date: Sun, 18 Aug 2019 20:27:15 -0500 Subject: [PATCH] Adding LOG statements to debug 1838449 Adding LOG statements to debug 1838449 Change-Id: I6f9cbe2e6b4ea0f122f5f8318dbbc31fce6b61f4 Related-Bug: #1838449 (cherry picked from commit 12760c94c89f654885d0432a4da37110c112be1a) --- neutron/api/rpc/handlers/l3_rpc.py | 7 +++++++ neutron/db/l3_dvrscheduler_db.py | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/neutron/api/rpc/handlers/l3_rpc.py b/neutron/api/rpc/handlers/l3_rpc.py index 5ca625be408..8702a91284a 100644 --- a/neutron/api/rpc/handlers/l3_rpc.py +++ b/neutron/api/rpc/handlers/l3_rpc.py @@ -116,6 +116,9 @@ class L3RpcCallback(object): router_ids = kwargs.get('router_ids') host = kwargs.get('host') context = neutron_context.get_admin_context() + LOG.debug('Sync routers for ids %(router_ids)s in %(host)s', + {'router_ids': router_ids, + 'host': host}) routers = self._routers_to_sync(context, router_ids, host) if extensions.is_extension_supported( self.plugin, constants.PORT_BINDING_EXT_ALIAS): @@ -125,6 +128,10 @@ class L3RpcCallback(object): pf_plugin = directory.get_plugin(plugin_constants.PORTFORWARDING) if pf_plugin: pf_plugin.sync_port_forwarding_fip(context, routers) + LOG.debug('The sync data for ids %(router_ids)s in %(host)s is: ' + '%(routers)s', {'router_ids': router_ids, + 'host': host, + 'routers': routers}) return routers def _routers_to_sync(self, context, router_ids, host=None): diff --git a/neutron/db/l3_dvrscheduler_db.py b/neutron/db/l3_dvrscheduler_db.py index d0c798da91a..6833a2d18dc 100644 --- a/neutron/db/l3_dvrscheduler_db.py +++ b/neutron/db/l3_dvrscheduler_db.py @@ -23,6 +23,7 @@ from neutron_lib.exceptions import l3 as l3_exc from neutron_lib.plugins import constants as plugin_constants from neutron_lib.plugins import directory from oslo_config import cfg +from oslo_log import helpers as log_helpers from oslo_log import log as logging from sqlalchemy import or_ @@ -416,6 +417,9 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin): context, agent_db, router_ids, with_dvr)) if not with_dvr: return result_set + LOG.debug("Routers %(router_ids)s bound to L3 agent in host %(host)s", + {'router_ids': result_set, + 'host': agent_db['host']}) router_ids = set(router_ids or []) if router_ids and result_set == router_ids: # no need for extra dvr checks if requested routers are @@ -442,13 +446,21 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin): list(subnet_ids))): result_set.add(router_id) + LOG.debug("Routers %(router_ids)s are scheduled or have " + "serviceable ports in host %(host)s", + {'router_ids': result_set, + 'host': agent_db['host']}) for dvr_router in dvr_routers: result_set |= set( self._get_other_dvr_router_ids_connected_router( context, dvr_router)) + LOG.debug("Router IDs %(router_ids)s for agent in host %(host)s", + {'router_ids': result_set, + 'host': agent_db['host']}) return list(result_set) + @log_helpers.log_method_call def _check_dvr_serviceable_ports_on_host(self, context, host, subnet_ids): """Check for existence of dvr serviceable ports on host