diff options
author | Ben Pfaff <blp@ovn.org> | 2018-11-13 09:26:40 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-11-19 08:47:36 -0800 |
commit | e83ea0d652f2a5bdcd8062dc28c7e9589e40b0f5 (patch) | |
tree | 409faa84bfbc850402b841300c106c7089c608dd /lib | |
parent | f50714bf9a729a6a6db6326f7523449ad80eef1e (diff) | |
download | openvswitch-e83ea0d652f2a5bdcd8062dc28c7e9589e40b0f5.tar.gz |
ovsdb-idl: Treat "unknown database" error as reason to reconnect.
Ordinarily the IDL finds out in advance whether a particular database is
on its server, or it finds out via notifications. But it's also a good
idea to adopt a belt-and-suspenders approach so that, if the IDL does
receive an "unknown database" error, we treat it as a "soft" error that
can be fixed by reconnecting to another server, rather than a "hard" error
that should cause an immediate abort.
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ovsdb-idl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index a1f246d6f..a7274dea2 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -4686,6 +4686,10 @@ ovsdb_idl_db_txn_process_reply(struct ovsdb_idl_db *db, if (error->type == JSON_STRING) { if (!strcmp(error->string, "timed out")) { soft_errors++; + } else if (!strcmp(error->string, + "unknown database")) { + ovsdb_idl_retry(db->idl); + soft_errors++; } else if (!strcmp(error->string, "not owner")) { lock_errors++; } else if (!strcmp(error->string, "not allowed")) { |