recoverd: Move the test for both 'DeterministicIPs' and 'NoIPFailback' set
authorMartin Schwenke <martin@meltin.net>
Fri, 14 Dec 2012 06:10:41 +0000 (17:10 +1100)
committerMartin Schwenke <martin@meltin.net>
Mon, 7 Jan 2013 23:16:11 +0000 (10:16 +1100)
If this is done earlier then some other logic can be improved.  Also,
this should be a warning since no error condition is set.

Signed-off-by: Martin Schwenke <martin@meltin.net>
server/ctdb_takeover.c

index 1823eed85bd304ae7cc6acf240ca5f773a066744..a7b194349b8c47c4f1e44cb46ecae5605d904e02 100644 (file)
@@ -2123,6 +2123,14 @@ static void ctdb_takeover_run_core(struct ctdb_context *ctdb,
                for (i=0,tmp_ip=all_ips;tmp_ip;tmp_ip=tmp_ip->next,i++) {
                        tmp_ip->pnn = i%nodemap->num;
                }
+
+               /* IP failback doesn't make sense with deterministic
+                * IPs, since the modulo step above implicitly fails
+                * back IPs to their "home" node.
+                */
+               if (1 == ctdb->tunable.no_ip_failback) {
+                       DEBUG(DEBUG_WARNING, ("WARNING: 'NoIPFailback' set but ignored - incompatible with 'DeterministicIPs\n"));
+               }
        }
 
 
@@ -2172,9 +2180,6 @@ try_again:
           This can NOT be used at the same time as DeterministicIPs !
        */
        if (1 == ctdb->tunable.no_ip_failback) {
-               if (1 == ctdb->tunable.deterministic_public_ips) {
-                       DEBUG(DEBUG_ERR, ("ERROR: You can not use 'DeterministicIPs' and 'NoIPFailback' at the same time\n"));
-               }
                goto finished;
        }