From patchwork Thu Dec 14 01:04:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1875932 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SrDhr5ksPz23nm for ; Thu, 14 Dec 2023 12:07:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id EC28783BDE; Thu, 14 Dec 2023 01:07:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org EC28783BDE X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05C5iovTcRG9; Thu, 14 Dec 2023 01:07:05 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id A469883BEF; Thu, 14 Dec 2023 01:07:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A469883BEF Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 892A6C0DCF; Thu, 14 Dec 2023 01:07:03 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 38F9AC0DD7 for ; Thu, 14 Dec 2023 01:07:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D1FC0834F5 for ; Thu, 14 Dec 2023 01:05:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D1FC0834F5 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8qlzdeEJ5zWi for ; Thu, 14 Dec 2023 01:05:32 +0000 (UTC) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by smtp1.osuosl.org (Postfix) with ESMTPS id B7253812E6 for ; Thu, 14 Dec 2023 01:05:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B7253812E6 Received: by mail.gandi.net (Postfix) with ESMTPSA id A2DD7240004; Thu, 14 Dec 2023 01:05:29 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Thu, 14 Dec 2023 02:04:19 +0100 Message-ID: <20231214010431.1664005-18-i.maximets@ovn.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231214010431.1664005-1-i.maximets@ovn.org> References: <20231214010431.1664005-1-i.maximets@ovn.org> MIME-Version: 1.0 X-GND-Sasl: i.maximets@ovn.org Cc: Vladislav Odintsov , Dumitru Ceara , Ilya Maximets Subject: [ovs-dev] [PATCH 17/22] ovsdb: replication: Allow to set all jsonrpc options. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Set all the options for the source connection, not only the inactivity probe interval. Signed-off-by: Ilya Maximets --- ovsdb/ovsdb-server.c | 11 ++++------- ovsdb/replication.c | 6 +++--- ovsdb/replication.h | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) 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 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);