diff mbox series

[ovs-dev,14/22] jsonrpc-server: Re-add remotes on role changes.

Message ID 20231214010431.1664005-15-i.maximets@ovn.org
State Superseded
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev,01/22] ovsdb-server.at: Enbale debug logs in active-backup tests. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Ilya Maximets Dec. 14, 2023, 1:04 a.m. UTC
It is currently not possible for the role to change in runtime
(unless a manual DB transaction is crafted), but it will be with
addition of a config file.

If the role changes, listening socket will be closed, and all
the connections to this remote will be terminated.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 ovsdb/jsonrpc-server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
index 81e9e48a0..f3b4961f3 100644
--- a/ovsdb/jsonrpc-server.c
+++ b/ovsdb/jsonrpc-server.c
@@ -330,7 +330,8 @@  ovsdb_jsonrpc_server_set_remotes(struct ovsdb_jsonrpc_server *svr,
         if (!options) {
             VLOG_INFO("%s: remote deconfigured", node->name);
             ovsdb_jsonrpc_server_del_remote(node);
-        } else if (options->dscp != remote->dscp) {
+        } else if (options->dscp != remote->dscp
+                   || !nullable_string_is_equal(options->role, remote->role)) {
             ovsdb_jsonrpc_server_del_remote(node);
          }
     }