Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2062374

Summary: ml2/ovn maintenance thread unable to handle deleted subnets
Product: Red Hat OpenStack Reporter: Terry Wilson <twilson>
Component: python-networking-ovnAssignee: OSP Team <rhos-maint>
Status: CLOSED ERRATA QA Contact: Bharath M V <bmv>
Severity: high Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: apevec, ekuris, jschluet, lhh, majopela, rhos-maint, scohen, slinaber, spower
Target Milestone: z9Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-networking-ovn-7.3.1-1.20220502142031.4e24f4c.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-07 20:25:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Terry Wilson 2022-03-09 16:28:19 UTC
Description of problem:
As of the fixes for:

https://bugzilla.redhat.com/show_bug.cgi?id=1994591
https://bugzilla.redhat.com/show_bug.cgi?id=2010243

The maintenance thread throws:
ERROR networking_ovn.common.maintenance [req-05ecce78-b0a7-44b8-a4c1-d7dc6d1e0ad4 - - - - -] Maintenance task: Failed to fix deleted resource e55383a3-efb0-4c9c-9ede-3cce5f60a65d (type: subnets): KeyError: 'uuid'
ERROR networking_ovn.common.maintenance Traceback (most recent call last):
ERROR networking_ovn.common.maintenance   File "/usr/lib/python3.6/site-packages/networking_ovn/common/maintenance.py", line 378, in check_for_inconsistencies
ERROR networking_ovn.common.maintenance     self._ovn_client.delete_subnet(row.resource_uuid)
ERROR networking_ovn.common.maintenance   File "/usr/lib/python3.6/site-packages/networking_ovn/common/ovn_client.py", line 2028, in delete_subnet
ERROR networking_ovn.common.maintenance     self._remove_subnet_dhcp_options(subnet_id, txn)
ERROR networking_ovn.common.maintenance   File "/usr/lib/python3.6/site-packages/networking_ovn/common/ovn_client.py", line 1894, in _remove_subnet_dhcp_options
ERROR networking_ovn.common.maintenance     dhcp_options['subnet']['uuid']))
ERROR networking_ovn.common.maintenance KeyError: 'uuid'

This will result in orphaned OVNRevisionNumbers entries in the mysql db, and as time goes on ever more repeated ERROR log messages as the maintenance thread tries and fails to fix deleted subnets without DHCP. Luckily, the fix is a very safe one-line change that is extremely unlikely to have any negative side effects.


Version-Release number of selected component (if applicable):
16.1_20220225.1


How reproducible:
100%

Steps to Reproduce:
1. Create a subnet with --no-dhcp
2. Delete the subnet


Actual results:
ERROR messages in the controller logs repeated every 5 mins by default, subnet entry in ovn_revision_numbers table is deleted

Expected results:
No errors, ovn_revision_numbers entry is deleted


Additional info:
A user could theoretically create and delete an unbounded number of subnets, causing the DB to grow with orphaned entries.

Comment 2 Terry Wilson 2022-03-09 16:31:48 UTC
> Actual results:
> ERROR messages in the controller logs repeated every 5 mins by default, subnet entry in ovn_revision_numbers table is deleted

entry in ovn_revision_numbers table is *not* deleted

Comment 18 errata-xmlrpc 2022-12-07 20:25:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1.9 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8795

Comment 19 Red Hat Bugzilla 2023-09-18 04:33:16 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days