Reviewed: https://review.opendev.org/747290 Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=13b894288e9354b9eb0833a635fe4a624bb068a9 Submitter: Zuul Branch: master
commit 13b894288e9354b9eb0833a635fe4a624bb068a9 Author: Slawek Kaplonski <[email protected]> Date: Thu Aug 20 22:39:04 2020 +0200 Fix deletion of subnet_id from pd_subnets In the RouterInfo._process_internal_ports() method when it process old ports and port belongs to the subnet with CIDR assigned by Prefix Delegation it will try to remove subnet_id key from the pd_subnets dict. However it seems that in some case it may happen that such subnet_id key is not added to the pd_subnets dict and processing of ports fails. We shouldn't fail in such case, if there is no subnet_id key in this dict we should be good as we want to delete it simply. So this patch changes that to not raise KeyError in such case. Change-Id: I6e6d890c196716c0ef4bcc2922f1ec4c142a6e79 Closes-Bug: #1892364 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1892364 Title: L3 agent prefix delegation - adding new subnet to the router fails Status in neutron: Fix Released Bug description: Adding new subnet with prefix delegation enabled to the router fails with error like: 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent [-] Error while deleting router 7ef0983f-60a4-4389-909c-785eb6c9a51e: KeyError: '999e404c-3c33-4123-9c61-99426f2e5c16' 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent Traceback (most recent call last): 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/agent/l3/agent.py", line 438, in _safe_router_removed 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self._router_removed(ri, router_id) 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/agent/l3/agent.py", line 474, in _router_removed 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self.router_info[router_id] = ri 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self.force_reraise() 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent six.reraise(self.type_, self.value, self.tb) 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/six.py", line 693, in reraise 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent raise value 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/agent/l3/agent.py", line 471, in _router_removed 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent ri.delete() 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/agent/l3/router_info.py", line 433, in delete 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self.process_delete() 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/common/utils.py", line 161, in call 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self.logger(e) 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/oslo_utils/excutils.py", line 220, in __exit__ 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self.force_reraise() 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/oslo_utils/excutils.py", line 196, in force_reraise 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent six.reraise(self.type_, self.value, self.tb) 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/six.py", line 693, in reraise 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent raise value 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/common/utils.py", line 158, in call 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent return func(*args, **kwargs) 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/agent/l3/router_info.py", line 1167, in process_delete 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent self._process_internal_ports() 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent File "/usr/lib/python3.6/site-packages/neutron/agent/l3/router_info.py", line 591, in _process_internal_ports 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent del self.pd_subnets[subnet['id']] 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent KeyError: '999e404c-3c33-4123-9c61-99426f2e5c16' 2020-08-20 11:22:41.356 1004285 ERROR neutron.agent.l3.agent I think we should simply handle the case when self.pd_subnets don't have key with subnet['id'] there. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1892364/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

