Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
ctdb-tools: Addition of IPs is deferred until the next takeover run
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Martin Schwenke <[email protected]>
  • Loading branch information
amitay authored and Martin Schwenke committed Aug 17, 2016
1 parent 639063d commit f635bd8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
13 changes: 8 additions & 5 deletions ctdb/doc/ctdb.1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
1 change: 1 addition & 0 deletions ctdb/tests/simple/16_ctdb_config_add_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions ctdb/tests/simple/60_recoverd_missing_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ctdb/tools/ctdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f635bd8

Please sign in to comment.