Skip to content

Commit

Permalink
ic: add support to configure ovsdb inactivity probe
Browse files Browse the repository at this point in the history
IDL to local AZ DBs (OVN_Northbound, OVN_Southbound) should be configured
in NB DB, table NB_Global, column options:ic_probe_interval.

IDL to global DBs (OVN_IC_Northbound, OVN_IC_Southbound) should be
configured in IC NB DB, table IC_NB_Global, column
options:ic_probe_interval.

Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
odivlad authored and numansiddique committed Mar 23, 2023
1 parent c3f577e commit 3d53fb2
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ic/ovn-ic.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "lib/ovn-util.h"
#include "memory.h"
#include "openvswitch/poll-loop.h"
#include "ovsdb-idl.h"
#include "simap.h"
#include "smap.h"
#include "sset.h"
Expand Down Expand Up @@ -1871,6 +1872,31 @@ update_ssl_config(void)
}
}

static void
update_idl_probe_interval(struct ovsdb_idl *ovn_sb_idl,
struct ovsdb_idl *ovn_nb_idl,
struct ovsdb_idl *ovn_icsb_idl,
struct ovsdb_idl *ovn_icnb_idl)
{
const struct nbrec_nb_global *nb = nbrec_nb_global_first(ovn_nb_idl);
int interval = -1;
if (nb) {
interval = smap_get_int(&nb->options, "ic_probe_interval", interval);
}
set_idl_probe_interval(ovn_sb_idl, ovnsb_db, interval);
set_idl_probe_interval(ovn_nb_idl, ovnnb_db, interval);

const struct icnbrec_ic_nb_global *icnb =
icnbrec_ic_nb_global_first(ovn_icnb_idl);
int ic_interval = -1;
if (icnb) {
ic_interval = smap_get_int(&icnb->options, "ic_probe_interval",
ic_interval);
}
set_idl_probe_interval(ovn_icsb_idl, ovn_ic_sb_db, ic_interval);
set_idl_probe_interval(ovn_icnb_idl, ovn_ic_nb_db, ic_interval);
}

int
main(int argc, char *argv[])
{
Expand Down Expand Up @@ -2071,6 +2097,8 @@ main(int argc, char *argv[])
state.paused = false;
while (!exiting) {
update_ssl_config();
update_idl_probe_interval(ovnsb_idl_loop.idl, ovnnb_idl_loop.idl,
ovnisb_idl_loop.idl, ovninb_idl_loop.idl);
memory_run();
if (memory_should_report()) {
struct simap usage = SIMAP_INITIALIZER(&usage);
Expand Down
14 changes: 14 additions & 0 deletions ovn-ic-nb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@
This column provides general key/value settings. The supported
options are described individually below.
</column>

<column name="options" key="ic_probe_interval">
<p>
The inactivity probe interval of the connection to the OVN IC
Northbound and Southbound databases from <code>ovn-ic</code>, in
milliseconds. If the value is zero, it disables the connection
keepalive feature.
</p>

<p>
If the value is nonzero, then it will be forced to a value of
at least 1000 ms.
</p>
</column>
</group>

<group title="Connection Options">
Expand Down
13 changes: 13 additions & 0 deletions ovn-nb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,19 @@
</p>
</column>

<column name="options" key="ic_probe_interval">
<p>
The inactivity probe interval of the connection to the OVN Northbound
and Southbound databases from <code>ovn-ic</code>, in milliseconds.
If the value is zero, it disables the connection keepalive feature.
</p>

<p>
If the value is nonzero, then it will be forced to a value of
at least 1000 ms.
</p>
</column>

<column name="options" key="northd_trim_timeout">
<p>
When used, this configuration value specifies the time, in
Expand Down

0 comments on commit 3d53fb2

Please sign in to comment.