ctdb-tools: Addition of IPs is deferred until the next takeover run
authorAmitay Isaacs <amitay@gmail.com>
Mon, 15 Aug 2016 05:54:51 +0000 (15:54 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 17 Aug 2016 03:28:19 +0000 (05:28 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12152

This makes the behaviour of "ctdb addip" similar to "ctdb delip".

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/doc/ctdb.1.xml
ctdb/tests/simple/16_ctdb_config_add_ip.sh
ctdb/tests/simple/60_recoverd_missing_ip.sh
ctdb/tools/ctdb.c

index 9324813fe51270f476fe55c7b17c2ae2cd9b9826..d2952137d3bf7eab440169e1988e280fe9154d3e 100644 (file)
@@ -1031,13 +1031,16 @@ DB Statistics: locking.tdb
     <refsect2>
       <title>addip <parameter>IPADDR</parameter>/<parameter>mask</parameter> <parameter>IFACE</parameter></title>
       <para>
-       This command is used to add a new public ip to a node during runtime.
-       This allows public addresses to be added to a cluster without having
-       to restart the ctdb daemons.
+       This command is used to add a new public ip to a node
+       during runtime.  It should be followed by a <command>ctdb
+       ipreallocate</command>.  This allows public addresses to be
+       added to a cluster without having to restart the ctdb daemons.
       </para>
       <para>
-       Note that this only updates the runtime instance of ctdb. Any changes will be lost next time ctdb is restarted and the public addresses file is re-read.
-       If you want this change to be permanent you must also update the public addresses file manually.
+       Note that this only updates the runtime instance of ctdb. Any
+       changes will be lost next time ctdb is restarted and the public
+       addresses file is re-read.  If you want this change to be
+       permanent you must also update the public addresses file manually.
       </para>
     </refsect2>
 
index d33ec040577897f3b5ea95d2ca639284d7df22f6..0bc668a906e328395aa81968976e1fda5c47c0ba 100755 (executable)
@@ -34,4 +34,5 @@ try_command_on_node -v all $CTDB ip
 
 echo "Adding IP ${test_ip}/${mask} on ${iface}, node ${test_node}"
 try_command_on_node $test_node $CTDB addip ${test_ip}/${mask} $iface
+try_command_on_node $test_node $CTDB ipreallocate
 wait_until_ips_are_on_node $test_node $test_ip
index cf68b19a515a32c915f75b41cd7269c23a9a2644..c6b4de073a8284fde6431be92ac81a36186bc24e 100755 (executable)
@@ -63,6 +63,7 @@ try_command_on_node $test_node $CTDB setifacelink $iface down
 
 echo "Adding IP $test_ip to node $test_node"
 try_command_on_node $test_node $CTDB addip $test_ip/$mask $iface
+try_command_on_node $test_node $CTDB ipreallocate
 
 echo "Wait long enough for IP verification to have taken place"
 sleep_for 15
index 2cb699aadf2c4cdc21de08deda786be636d72725..d96ee8800d001dc5c4838800e2a5fc993cc59584 100644 (file)
@@ -3960,7 +3960,7 @@ static int control_addip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
                return ret;
        }
 
-       return ipreallocate(mem_ctx, ctdb);
+       return 0;
 }
 
 static int control_delip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,