Re: Pointers on the ovsdb bug - https://bugs.opendaylight.org/show_bug.cgi?id=3989


Anil Vishnoi
 

Hi Raksha,

I added comment on the gerrit, lets discuss it over the gerrit, to keep track of the discussion for others reference.

Thanks
Anil

On Tue, Aug 18, 2015 at 11:58 PM, Madhava Bangera, Raksha <raksha.madhava.bangera@...> wrote:

Hi All,

 

I am working on the bug https://bugs.opendaylight.org/show_bug.cgi?id=3989 and the fix is based on the approach 1 suggested in the description. I submitted https://git.opendaylight.org/gerrit/#/c/24739/ patch. This patch prevents the duplicate node( having same connection info) from being added to operational datastore. But the duplicate node is present in the config store. As per the review comments, the duplicate node should be prevented from being added to config DS too.

 

I have made the below highlighted changes to the patch. But with this logic, the duplicate node is not completely removed from the config. The {remote IP, port} tuple gets deleted but the node ID stills floats in the config. Could anyone give me pointers on how I can delete the duplicate node completely from the config? Or, is there a way to block the entry of duplicate node to config somewhere?

 

public void onDataChanged(

           AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes) {

       LOG.trace("onDataChanged: {}", changes);

       for (Entry<InstanceIdentifier<?>, DataObject> created : changes.getCreatedData().entrySet()) {

           // TODO validate we have the correct kind of InstanceIdentifier

           if (created.getValue() instanceof OvsdbNodeAugmentation) {

               OvsdbNodeAugmentation ovsdbNode = (OvsdbNodeAugmentation)created.getValue();

               ConnectionInfo key = ovsdbNode.getConnectionInfo();

               InstanceIdentifier<Node> iid = cm.getInstanceIdentifier(key);

               if ( iid != null) {

                   InstanceIdentifier<Node> dupiid = (InstanceIdentifier<Node>) created.getKey();

                   ReadWriteTransaction transaction = db.newReadWriteTransaction();

                   transaction.delete(LogicalDatastoreType.CONFIGURATION, dupiid);

                   CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();

                   try {

                       future.checkedGet();

                   } catch (TransactionCommitFailedException

                           e) {

                       LOG.warn("Failed to delete {} ", dupiid, e);

                   }

                   return;

               }

           }

       }

       // Connect first if we have to:

       connect(changes);

       rest of the code

}

 

Thanks & Regards,

Raksha

 


_______________________________________________
ovsdb-dev mailing list
ovsdb-dev@...
https://lists.opendaylight.org/mailman/listinfo/ovsdb-dev




--
Thanks
Anil

Join z.archive.ovsdb-dev@lists.opendaylight.org to automatically receive all group messages.