Corrupt relationships with empty parent or child can be seen in the relationship table


Description

When a Network adaptor, IP address or a network related record (seen in the below tables) is marked as absent, there are cleanup jobs that run and delete all these records. The problem here is that it when the Table Cleanup runs and delete CIs, it doesn't delete the relationship record and leaves orphaned Relationships.

dscy_route_next_hop
dscy_route_interface
dscy_router_interface
cmdb_ci_network_adapter
cmdb_ci_ip_address
cmdb_tcp


Steps to Reproduce

1./ Run discovery for one of your servers. Discovery will create a relationship record between the server and the network adaptor.
2./ Change the adaptor/IP on the server and rediscover it
3./ Discovery will create a new adaptor/IP record,  a new relationship record and will mark the old one as absent.
4./ When the cleanup job runs (OOB, it deletes records that are absent for a month but it is costumizable), it will delete the record but the relationship will not be deleted

Workaround

Enable Cascade Delete by ticking the check box on the 6 table cleanup job records mentioned. You can find them in the below link:

https://<instance_name>.service-now.com/sys_auto_flush_list.do?sysparm_query=sys_idIN7b605603ef32010098d5925495c0fb19%2Cb872259689304500af6ad4dbba623bb0%2C7557cffeb301130099cd6330c6a8dc83%2Cdf67cffeb301130099cd6330c6a8dc7a%2C86478ffeb301130099cd6330c6a8dcab%2Ce559a907efa7200098d5925495c0fb33&sysparm_view=

Please replace <instance_name> with your instance.

NOTE: if the above link does not show 6 table cleanup jobs then please search for the missing one by searching for the table names provided above.


Related Problem: PRB1414566