summaryrefslogtreecommitdiffstats
path: root/ctdb/tcp/tcp_init.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-06-01 14:18:34 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-06-01 14:18:34 +1000
commite6170b53894ce188a574c9359e2b8b2797e4e2d1 (patch)
tree28c61aa02c6d1e5fdbddfdb4774bcd54c3ab5d11 /ctdb/tcp/tcp_init.c
parent42591560506c7fee977975e261e4790ae1a0f97f (diff)
downloadsamba-e6170b53894ce188a574c9359e2b8b2797e4e2d1.tar.gz
samba-e6170b53894ce188a574c9359e2b8b2797e4e2d1.tar.xz
samba-e6170b53894ce188a574c9359e2b8b2797e4e2d1.zip
add a new node state : DELETED.
This is used to mark nodes as being DELETED internally in ctdb so that nodes are not renumbered if / when they are removed from the nodes file. This is used to be able to do "ctdb reloadnodes" at runtime without causing nodes to be renumbered. To do this, instead of deleting a node from the nodes file, just comment it out like 1.0.0.1 #1.0.0.2 1.0.0.3 After removing 1.0.0.2 from the cluster, the remaining nodes retain their pnn's from prior to the deletion, namely 0 and 2 Any line in the nodes file that is commented out represents a DELETED pnn (This used to be ctdb commit 6a5e4fd7fa391206b463bb4e976502f3ac5bd343)
Diffstat (limited to 'ctdb/tcp/tcp_init.c')
-rw-r--r--ctdb/tcp/tcp_init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index c0606f0ec5..58ed6c8a28 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -69,7 +69,10 @@ static int ctdb_tcp_initialise(struct ctdb_context *ctdb)
exit(1);
}
- for (i=0; i<ctdb->num_nodes; i++) {
+ for (i=0; i < ctdb->num_nodes; i++) {
+ if (ctdb->nodes[i]->flags & NODE_FLAGS_DELETED) {
+ continue;
+ }
if (ctdb_tcp_add_node(ctdb->nodes[i]) != 0) {
DEBUG(DEBUG_CRIT, ("methods->add_node failed at %d\n", i));
return -1;
@@ -135,7 +138,10 @@ static int ctdb_tcp_start(struct ctdb_context *ctdb)
{
int i;
- for (i=0; i<ctdb->num_nodes; i++) {
+ for (i=0; i < ctdb->num_nodes; i++) {
+ if (ctdb->nodes[i]->flags & NODE_FLAGS_DELETED) {
+ continue;
+ }
ctdb_tcp_connect_node(ctdb->nodes[i]);
}