TEP is part of old and new TZ when tz is updated after del-manager 14/90914/3
authorNishchya Gupta <nishchyag@altencalsoftlabs.com>
Fri, 3 Jul 2020 12:09:11 +0000 (17:39 +0530)
committerHema Gopalakrishnan <hema.gopalkrishnan@ericsson.com>
Sun, 26 Jul 2020 10:47:30 +0000 (10:47 +0000)
commit16a37b1fe7953953a57d3381dcede09cf3677a1a
treedca25c54bba6f928ffb8783502890b9605c2bb8f
parent41bcdc3c38633bade2a55cec9b9e993d774edb7c
TEP is part of old and new TZ when tz is updated after  del-manager

Issue observed:
1. TZA was present and TEPs were part of it.
2. ovsdb connection is removed by running delete-manager command on
switch
3. Change transport-zone of TEPs from TZA to TZC
4. ovsdb connection is set again by running set-manager command on
switch
5. TEPs go under teps-not-hosted since TZC is not yet present. It is
noted here that TEPs are still part of TZA in ITM config DS.
6. TZC is created from northbound
7. TEPs are moved from teps-not-hosted to TZC.
8. In the end, TEPs are part of TZA and TZC both. This is issue.

Fix provided:
When TEPs add notification come again with updated TZC, then
check if same TEP (key: dpid) is already present in any other TZ.
If present, then remove TEP from old TZ and then add TEP into newly
configured TZ.

Signed-off-by: Nishchya Gupta <nishchyag@altencalsoftlabs.com>
Change-Id: I98c3c89f70e60676ea9c5f73d90b1a750943e7a5
itm/itm-impl/src/main/java/org/opendaylight/genius/itm/confighelpers/OvsdbTepAddConfigHelper.java
itm/itm-impl/src/main/java/org/opendaylight/genius/itm/impl/ItmUtils.java
itm/itm-impl/src/test/java/org/opendaylight/genius/itm/tests/ItmTepAutoConfigTestUtil.java