From 4afba466e04fb74c8915f9f1b40686008b2503fb Mon Sep 17 00:00:00 2001 From: zhanghao Date: Sun, 17 Nov 2019 20:17:35 -0500 Subject: [PATCH] Make network support read and write separation When 'slave_connection' is configured in neutron.conf, executing the 'neutron port-show' command will read the port information from the slave database nodes, but the network will not be able to read the information from the slave database nodes. Change-Id: I572cecace1016740584757e5f926d246ead2d9a0 Closes-Bug: #1840638 --- neutron/plugins/ml2/plugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 167a82de975..32cbe35df47 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -1139,9 +1139,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, @db_api.retry_if_session_inactive() def get_network(self, context, id, fields=None): - # NOTE(ihrachys) use writer manager to be able to update mtu - # TODO(ihrachys) remove in Queens+ when mtu is not nullable - with db_api.CONTEXT_WRITER.using(context): + with db_api.CONTEXT_READER.using(context): net_db = self._get_network(context, id) net_data = self._make_network_dict(net_db, context=context)