ovn: Override clean_hash_ring for sync util

ML2 OVN Mechanism driver wipes all the nodes from ovn_hash_ring table on
initialization. The DB sync untility inherits from the mechanism driver
calling the cleanup whenever sync util is executed. This leads to nodes
being deleted while neutron-server is typically running, causing serious
issues to neutron-server until it is restarted.

This patch overrides the clean method to no-op.

Change-Id: I5ea8278c0387009ff429572662d64e7664f493e7
Closes-Bug: #1879950
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
This commit is contained in:
Jakub Libosvar 2020-05-21 15:16:54 +00:00
parent ac86b58c26
commit f5c3910771
1 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,14 @@ class OVNMechanismDriver(mech_driver.OVNMechanismDriver):
def ovn_client(self):
return self._ovn_client
def _clean_hash_ring(self):
"""Don't clean the hash ring.
If this method was not overriden, cleanup would be performed when
calling the db sync and running neutron server would lose all the nodes
from the ring.
"""
# Since we are not using the ovn mechanism driver while syncing,
# we override the post and pre commit methods so that original ones are
# not called.