diff mbox series

[ovs-dev,17/22] ovsdb: replication: Allow to set all jsonrpc options.

Message ID 20231214010431.1664005-18-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
Set all the options for the source connection, not only the
inactivity probe interval.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 ovsdb/ovsdb-server.c | 11 ++++-------
 ovsdb/replication.c  |  6 +++---
 ovsdb/replication.h  |  3 ++-
 3 files changed, 9 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index eceed7b54..6eced3896 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -1024,7 +1024,7 @@  open_db(struct server_config *server_config,
 
         server_uuid = ovsdb_jsonrpc_server_get_uuid(server_config->jsonrpc);
         replication_set_db(db->db, conf->source, conf->ab.sync_exclude,
-                           server_uuid, conf->options->rpc.probe_interval);
+                           server_uuid, &conf->options->rpc);
     }
     return NULL;
 }
@@ -1731,8 +1731,7 @@  ovsdb_server_connect_active_ovsdb_server(struct unixctl_conn *conn,
 
             if (conf->model == SM_ACTIVE_BACKUP && !conf->ab.backup) {
                 replication_set_db(db->db, conf->source, conf->ab.sync_exclude,
-                                   server_uuid,
-                                   conf->options->rpc.probe_interval);
+                                   server_uuid, &conf->options->rpc);
                 conf->ab.backup = true;
             }
         }
@@ -1801,8 +1800,7 @@  ovsdb_server_set_active_ovsdb_server_probe_interval(struct unixctl_conn *conn,
             conf->options->rpc.probe_interval = probe_interval;
             if (conf->ab.backup) {
                 replication_set_db(db->db, conf->source, conf->ab.sync_exclude,
-                                   server_uuid,
-                                   conf->options->rpc.probe_interval);
+                                   server_uuid, &conf->options->rpc);
             }
         }
     }
@@ -1881,8 +1879,7 @@  ovsdb_server_set_sync_exclude_tables(struct unixctl_conn *conn,
             conf->ab.sync_exclude = xstrdup(argv[1]);
             if (conf->ab.backup) {
                 replication_set_db(db->db, conf->source, conf->ab.sync_exclude,
-                                   server_uuid,
-                                   conf->options->rpc.probe_interval);
+                                   server_uuid, &conf->options->rpc);
             }
         }
     }
diff --git a/ovsdb/replication.c b/ovsdb/replication.c
index 3a062b078..858a833bb 100644
--- a/ovsdb/replication.c
+++ b/ovsdb/replication.c
@@ -108,7 +108,7 @@  static bool request_id_compare_and_free(struct replication_db *,
 void
 replication_set_db(struct ovsdb *db, const char *sync_from,
                    const char *exclude_tables, const struct uuid *server,
-                   int probe_interval)
+                   const struct jsonrpc_session_options *options)
 {
     struct replication_db *rdb = find_db(db->name);
 
@@ -124,7 +124,7 @@  replication_set_db(struct ovsdb *db, const char *sync_from,
     if (rdb
         && nullable_string_is_equal(rdb->excluded_tables_str, exclude_tables)
         && nullable_string_is_equal(rdb->sync_from, sync_from)) {
-        jsonrpc_session_set_probe_interval(rdb->session, probe_interval);
+        jsonrpc_session_set_options(rdb->session, options);
         return;
     }
 
@@ -147,7 +147,7 @@  replication_set_db(struct ovsdb *db, const char *sync_from,
     rdb->session = jsonrpc_session_open(rdb->sync_from, true);
     rdb->session_seqno = UINT_MAX;
 
-    jsonrpc_session_set_probe_interval(rdb->session, probe_interval);
+    jsonrpc_session_set_options(rdb->session, options);
 
     rdb->state = RPL_S_INIT;
     rdb->db->read_only = true;
diff --git a/ovsdb/replication.h b/ovsdb/replication.h
index f5e226753..a2ed5f02e 100644
--- a/ovsdb/replication.h
+++ b/ovsdb/replication.h
@@ -20,6 +20,7 @@ 
 
 #include <stdbool.h>
 struct ovsdb;
+struct jsonrpc_session_options;
 
 /* Replication module runs when OVSDB server runs in the backup mode.
  *
@@ -47,7 +48,7 @@  struct ovsdb;
 
 void replication_set_db(struct ovsdb *, const char *sync_from,
                         const char *exclude_tables, const struct uuid *server,
-                        int probe_interval);
+                        const struct jsonrpc_session_options *);
 void replication_remove_db(const struct ovsdb *);
 
 void replication_run(void);