Bug 2295192

Summary: Stale entries remain in Chassis_Private after delete network agent
Product: Red Hat OpenStack Reporter: Fernando Royo <froyo>
Component: openstack-neutronAssignee: Fernando Royo <froyo>
Status: CLOSED MIGRATED QA Contact: Eran Kuris <ekuris>
Severity: medium Docs Contact:
Priority: medium    
Version: 17.1 (Wallaby)CC: bcafarel, chrisw, egarciar, scohen
Target Milestone: asyncKeywords: Triaged
Target Release: 17.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-10 10:07:01 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 Fernando Royo 2024-07-02 15:40:43 UTC
Description of problem:
When for some reason (e.g. ovn-controller ends not gracefully) stale entries appear on Chassis_Private, with pointing to a Chassis [ ], at this situation the admin user is invited to delete them using:

- openstack network agent delete <id> 

And we trust that this command will also delete the stale entry in the OVN SB DB Chassis_Private table, but this is not happening.


Steps to Reproduce:
1. Create a stale row in Chassis_Private table as:

ovn-sbctl create Chassis_Private chassis=[] name="4b401646-3c64-42de-b693-87b3ae0ffeee"

2. Check that OVN SB DB include this new stale entry

[root@controller-2 /]# ovn-sbctl list Chassis_private | grep -C5 4b401646-3c64-42de-b693-87b3ae0ffeee
_uuid               : 6ec304f1-1bea-4696-8ba7-d1ce01d4cc96
chassis             : []
external_ids        : {}
name                : "4b401646-3c64-42de-b693-87b3ae0ffeee"
nb_cfg              : 0
nb_cfg_timestamp    : 0

3. Confirm that it is shown in output from openstack network agent list

+--------------------------------------+------------------------------+------------------------------+-------+-------+----------------------------+                                                                                                                                                      
| ID                                   | Agent Type                   | Host                         | Alive | State | Binary                     |                                                                                                                                                      
+--------------------------------------+------------------------------+------------------------------+-------+-------+----------------------------+                                                                                                                                                      
| 4b401646-3c64-42de-b693-87b3ae0ffeee | OVN Controller agent         | ("Chassis" register deleted) | XXX   | UP    | ovn-controller             | 

4. Remove it doing 'openstack network agent delete 4b401646-3c64-42de-b693-87b3ae0ffeee


Actual results:
No errors output but stale entry still in OVN SB DB Chassis_private table


Expected results:
Stale entry deleted from OVN SB DB Chassis_private