summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdbd.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-12-04 14:28:06 +1100
committerAmitay Isaacs <amitay@gmail.com>2013-01-07 10:35:39 +1100
commit6fbd3ea2c2d516084c4ef887af3a6ac048bd2eba (patch)
treed03a5af9b1306f5b28578e81c877b9bf0b9df3de /ctdb/server/ctdbd.c
parent80a2bb84e7d04f4ee3b3369f734b80dce184ad72 (diff)
downloadsamba-6fbd3ea2c2d516084c4ef887af3a6ac048bd2eba.tar.gz
samba-6fbd3ea2c2d516084c4ef887af3a6ac048bd2eba.tar.xz
samba-6fbd3ea2c2d516084c4ef887af3a6ac048bd2eba.zip
ctdbd: Initialise the node flags in just one place
Currently flags are initialised in 2 places. One of them is in ctdb_tcp_listen_automatic(), which just seems wrong. This makes the code easier to follow by just doing it in ctdb_start_daemon(). This means that the flags are now initialised later than previously. However, it is still done before the transport is started and before clients can connect. In future it might make sense to do a similar thing with setting the PNN. However, the current optimisation is reasonably obvious... Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 2bbee8ac23ad5b7adf7122d8c91d5f0d54582507)
Diffstat (limited to 'ctdb/server/ctdbd.c')
-rw-r--r--ctdb/server/ctdbd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index bcc950266a4..491b4a2ff14 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -242,6 +242,16 @@ int main(int argc, const char *argv[])
ctdb->capabilities |= CTDB_CAP_LVS;
}
+ /* Initialise this node's PNN to the unknown value. This will
+ * be set to the correct value by either ctdb_add_node() as
+ * part of loading the nodes file or by
+ * ctdb_tcp_listen_automatic() when the transport is
+ * initialised. At some point we should de-optimise this and
+ * pull it out into ctdb_start_daemon() so it is done clearly
+ * and only in one place.
+ */
+ ctdb->pnn = -1;
+
/* tell ctdb what nodes are available */
ctdb_load_nodes_file(ctdb);