Fix delete of Logical_Switch for the "referential integrity violation" failure. 68/88968/4
authorChandra Shekar S <chandra.shekar.s@ericsson.com>
Wed, 8 Apr 2020 08:50:31 +0000 (14:20 +0530)
committerChandra Shekar S <chandra.shekar.s@ericsson.com>
Mon, 13 Apr 2020 05:25:43 +0000 (10:55 +0530)
commit7b105803ed5a0482e11c8f6eb6344b9a1a8f79a0
tree8f0ce1fca26a8b0a205dc08a6e01683330b53d98
parent42127c1a5053071389047e885e9bc09973e62190
Fix delete of Logical_Switch for the "referential integrity violation" failure.

Currently the Logical_Switch delete is failing with "referential integrity violation" error as listed below
2020-04-13T05:27:36,854 | ERROR | hwvtep-waiting-job-0 | TransactInvokerImpl              | 403 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.11.0.SNAPSHOT | HWVTEP transaction operation failed referential integrity violation cannot delete Logical_Switch row 7392ce5a-1bf6-4951-a22e-740ac78aaa60 because of 9 remaining reference(s)
2020-04-13T05:27:36,855 | ERROR | hwvtep-waiting-job-0 | TransactInvokerImpl              | 403 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.11.0.SNAPSHOT | Failed transaction delete from Logical_Switchdelete from Ucast_Macs_Remotedelete from Ucast_Macs_Localdelete from Mcast_Macs_Remotedelete from Mcast_Macs_Local
2020-04-13T05:27:36,856 | ERROR | hwvtep-waiting-job-0 | TransactInvokerImpl              | 403 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.11.0.SNAPSHOT | Failed on second attempt too aborting the transaction org.opendaylight.ovsdb.hwvtepsouthbound.transact.LogicalSwitchRemoveCommand$1@575aaf7c
2020-04-13T05:27:36,857 | ERROR | hwvtep-waiting-job-0 | TransactInvokerImpl              | 403 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.11.0.SNAPSHOT | HWVTEP transaction operation failed referential integrity violation cannot delete Logical_Switch row 064cc69b-cce8-4f08-9478-9b82c6059cac because of 9 remaining reference(s)
2020-04-13T05:27:36,858 | ERROR | hwvtep-waiting-job-0 | TransactInvokerImpl              | 403 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.11.0.SNAPSHOT | Failed transaction delete from Logical_Switchdelete from Ucast_Macs_Remotedelete from Ucast_Macs_Localdelete from Mcast_Macs_Remotedelete from Mcast_Macs_Local
2020-04-13T05:27:36,858 | ERROR | hwvtep-waiting-job-0 | TransactInvokerImpl              | 403 - org.opendaylight.ovsdb.hwvtepsouthbound-impl - 1.11.0.SNAPSHOT | Failed on second attempt too aborting the transaction org.opendaylight.ovsdb.hwvtepsouthbound.transact.LogicalSwitchRemoveCommand$1@569e133b

The Logical_Switch reference will be present in other tables like Ucast_Macs_Remote, Pysical_Port and Ucast_Macs_Remote etc.
These should be deleted first when the Logical_Switch is going to be deleted.

Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Change-Id: Ic2b101368bd50f6494e357fa49ccf53e641a09a3
16 files changed:
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundConstants.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/AbstractTransactCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/DependencyQueue.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/DependentJob.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/HwvtepOperationalState.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalSwitchRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalSwitchUcastsRemoveCommand.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/McastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PhysicalPortUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/PlainLogicalSwitchRemoveCmd.java [new file with mode: 0644]
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/UcastMacsRemoteRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/UcastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/DependencyQueueTest.java