ovn-controller: Drop remove_local_datapath_by_binding().
authorRussell Bryant <russell@ovn.org>
Mon, 18 Jul 2016 20:25:20 +0000 (16:25 -0400)
committerRussell Bryant <russell@ovn.org>
Mon, 18 Jul 2016 21:01:43 +0000 (17:01 -0400)
commitfdb3c70c3ee54ce362a92c31adee3908251b39a0
treefe0f281a2f4d57b88a1cbc7de08870b02e027d61
parent564666e9db0e59e6ed108924f5a0dd3808a46a26
ovn-controller: Drop remove_local_datapath_by_binding().

ovn-controller has an hmap called 'local_datapaths' which tracks
all OVN datapaths that have at least one port binding on the local
chassis.  This patch corrects the case where a port binding row is
deleted from the southbound DB while it's still bound to the chassis,
meaning it was deleted before the ovs interface was deleted.

The previous code tried to handle this case by calling
remove_local_datapath_by_binding().  The function appears to try
to look up local_datapath by the binding UUID.  If it finds it,
it will delete the local datapath entry.  On the surface, this
looks like a bug where it deletes a local datapath entry even
when there could be other ports still bound to the chassis.
The reality is that this function was always a no-op.  It was
doing a lookup using a different hash value than how local_datapath
entries are actually hashed. In practice, this wasn't a big problem
because local_datapaths are correctly cleaned in in the
process_full_binding case after an ovs interface is added or removed.

The new change ensures that we run the process_full_binding code
in this case right away, even if the interface is not deleted.

Fixes: 263064aeaa31 ("Convert binding_run to incremental processing.")
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
ovn/controller/binding.c