diff mbox series

[ovs-dev,v3] northd: Don't poll ovsdb before the connection is fully established

Message ID 9d5607e4-5a99-941d-92e4-ed8326129a9b@gmail.com
State Superseded
Headers show
Series [ovs-dev,v3] northd: Don't poll ovsdb before the connection is fully established | expand

Commit Message

Renat Nurgaliyev Nov. 10, 2020, 12:24 p.m. UTC
Set initial SB and NB DBs probe interval to 0 to avoid connection
flapping.

Before configured in northd_probe_interval value is actually applied
to southbound and northbound database connections, both connections
must be fully established, otherwise ovnnb_db_run() will return
without retrieving configuration data from northbound DB. In cases
when southbound database is big enough, default interval of 5 seconds
will kill and retry the connection before it is fully established, no
matter what is set in northd_probe_interval. Client reconnect will
cause even more load to ovsdb-server and cause cascade effect, so
northd can never stabilise. We have more than 2000 ports in our lab,
and northd could not start before this patch, holding at 100% CPU
utilisation both itself and ovsdb-server.

After connections are established, any value in northd_probe_interval,
or default DEFAULT_PROBE_INTERVAL_MSEC is applied correctly.

Signed-off-by: Renat Nurgaliyev <impleman@gmail.com>
---
v2:
- Resubmitting patch because git am failed last time
v3:
- Resubmitting patch because mail client broke formatting
---
  northd/ovn-northd.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 684c2bd47..073c6a0f3 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -100,7 +100,7 @@  static struct eth_addr svc_monitor_mac_ea;
  
  /* Default probe interval for NB and SB DB connections. */
  #define DEFAULT_PROBE_INTERVAL_MSEC 5000
-static int northd_probe_interval_nb = DEFAULT_PROBE_INTERVAL_MSEC;
-static int northd_probe_interval_sb = DEFAULT_PROBE_INTERVAL_MSEC;
+static int northd_probe_interval_nb = 0;
+static int northd_probe_interval_sb = 0;
  
  #define MAX_OVN_TAGS 4096