summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHan Zhou <hzhou8@ebay.com>2019-08-19 09:29:57 -0700
committerBen Pfaff <blp@ovn.org>2019-08-21 11:30:03 -0700
commitca367fa5f8bb40a5d0b695df9ca25c26974b792f (patch)
treee3e4f10764c1d86ef6012c9b809217bc974caf0b /lib
parentf4bef8b39a36c6a8b0b55ba662b4dfd9e5f6db97 (diff)
downloadopenvswitch-ca367fa5f8bb40a5d0b695df9ca25c26974b792f.tar.gz
ovsdb-idl.c: Allows retry even when using a single remote.
When clustered mode is used, the client needs to retry connecting to new servers when certain failures happen. Today it is allowed to retry new connection only if multiple remotes are used, which prevents using LB VIP with clustered nodes. This patch makes sure the retry logic works when using LB VIP: although same IP is used for retrying, the LB can actually redirect the connection to a new node. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ovsdb-idl.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 1a6a4afe5..190143f36 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -657,12 +657,8 @@ ovsdb_idl_state_to_string(enum ovsdb_idl_state state)
static void
ovsdb_idl_retry_at(struct ovsdb_idl *idl, const char *where)
{
- if (idl->session && jsonrpc_session_get_n_remotes(idl->session) > 1) {
- ovsdb_idl_force_reconnect(idl);
- ovsdb_idl_transition_at(idl, IDL_S_RETRY, where);
- } else {
- ovsdb_idl_transition_at(idl, IDL_S_ERROR, where);
- }
+ ovsdb_idl_force_reconnect(idl);
+ ovsdb_idl_transition_at(idl, IDL_S_RETRY, where);
}
static void
@@ -1895,8 +1891,7 @@ ovsdb_idl_check_server_db(struct ovsdb_idl *idl)
if (!database) {
VLOG_INFO_RL(&rl, "%s: server does not have %s database",
server_name, idl->data.class_->database);
- } else if (!strcmp(database->model, "clustered")
- && jsonrpc_session_get_n_remotes(idl->session) > 1) {
+ } else if (!strcmp(database->model, "clustered")) {
uint64_t index = database->n_index ? *database->index : 0;
if (!database->schema) {