ctdb-recoverd: Unify takeover run triggering code in main loop
authorMartin Schwenke <martin@meltin.net>
Tue, 3 May 2016 06:07:34 +0000 (16:07 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 13 May 2016 15:15:57 +0000 (17:15 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri May 13 17:15:57 CEST 2016 on sn-devel-144

ctdb/server/ctdb_recoverd.c

index 0839691268e1ba9c95dabfe4d42a6d9703241b75..09940dc32f881b05a277b5299510fa9bf576e8f0 100644 (file)
@@ -3871,21 +3871,12 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 
 takeover_run_checks:
 
-       /* if there are takeovers requested, perform it and notify the waiters */
+       /* If there are IP takeover runs requested or the previous one
+        * failed then perform one and notify the waiters */
        if (!ctdb_op_is_disabled(rec->takeover_run) &&
-           rec->reallocate_requests) {
+           (rec->reallocate_requests || rec->need_takeover_run)) {
                process_ipreallocate_requests(ctdb, rec);
        }
-
-       /* we might need to change who has what IP assigned */
-       if (rec->need_takeover_run) {
-               /* If takeover run fails, then the offending nodes are
-                * assigned ban culprit counts. And we re-try takeover.
-                * If takeover run fails repeatedly, the node would get
-                * banned.
-                */
-               do_takeover_run(rec, nodemap);
-       }
 }
 
 /*