diff mbox

[ovs-dev,1/3] ovsdb: Gracefully handle replication errors.

Message ID 1486528822-38533-1-git-send-email-azhou@ovn.org
State Accepted
Headers show

Commit Message

Andy Zhou Feb. 8, 2017, 4:40 a.m. UTC
Sometimes replication session can fail mostly due to replication
configurations. i.e. replicating from a database with a different
version of the schema.

Currently, those errors are treated as fatal errors, and stops the
OVSDB server. A better way to handle those error may be to stop
only the replication session, and leave the OVSDB server up, so that
the replication can be restarted, may be with a different configuration,
at a later time.

Signed-off-by: Andy Zhou <azhou@ovn.org>
---
 ovsdb/ovsdb-server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ben Pfaff Feb. 8, 2017, 7:25 p.m. UTC | #1
On Tue, Feb 07, 2017 at 08:40:20PM -0800, Andy Zhou wrote:
> Sometimes replication session can fail mostly due to replication
> configurations. i.e. replicating from a database with a different
> version of the schema.
> 
> Currently, those errors are treated as fatal errors, and stops the
> OVSDB server. A better way to handle those error may be to stop
> only the replication session, and leave the OVSDB server up, so that
> the replication can be restarted, may be with a different configuration,
> at a later time.
> 
> Signed-off-by: Andy Zhou <azhou@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 1b0060b..9b669c9 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -199,8 +199,8 @@  main_loop(struct ovsdb_jsonrpc_server *jsonrpc, struct shash *all_dbs,
         if (*is_backup) {
             replication_run();
             if (!replication_is_alive()) {
-                int retval = replication_get_last_error();
-                ovs_fatal(retval, "replication connection failed");
+                disconnect_active_server();
+                *is_backup = false;
             }
         }