summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2015-04-01 17:10:46 +1100
committerAmitay Isaacs <amitay@samba.org>2015-04-07 07:43:12 +0200
commit181658f5bb180c48f88504a703ed3a3758ac3b5b (patch)
tree501704fd1dcc09d183595ed7a73322009921a814 /ctdb
parentb57c77849af968e7a89df40d05b2e3ef7cef42c1 (diff)
downloadsamba-181658f5bb180c48f88504a703ed3a3758ac3b5b.tar.gz
ctdb-tools: Fix spurious messages about deleted nodes being disconnected
The code was too "clever". The 4 different cases should be separate. The "node remains deleted" case doesn't need the IP address comparison (always 0.0.0.0) or the disconnected check. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tools/ctdb.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 2331ead7bdb..2c906a5423e 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -6279,8 +6279,15 @@ static bool sanity_check_nodes_file_changes(TALLOC_CTX *mem_ctx,
should_abort = true;
continue;
}
- if ((nodemap->nodes[i].flags & NODE_FLAGS_DELETED) ==
- (file_nodemap->nodes[i].flags & NODE_FLAGS_DELETED)) {
+ if (nodemap->nodes[i].flags & NODE_FLAGS_DELETED &&
+ file_nodemap->nodes[i].flags & NODE_FLAGS_DELETED) {
+ /* Node remains deleted */
+ DEBUG(DEBUG_INFO,
+ ("Node %u is unchanged (DELETED)\n",
+ nodemap->nodes[i].pnn));
+ } else if (!(nodemap->nodes[i].flags & NODE_FLAGS_DELETED) &&
+ !(file_nodemap->nodes[i].flags & NODE_FLAGS_DELETED)) {
+ /* Node not newly nor previously deleted */
if (!ctdb_same_ip(&nodemap->nodes[i].addr,
&file_nodemap->nodes[i].addr)) {
DEBUG(DEBUG_ERR,
@@ -6301,9 +6308,8 @@ static bool sanity_check_nodes_file_changes(TALLOC_CTX *mem_ctx,
nodemap->nodes[i].pnn));
}
}
- continue;
- }
- if (file_nodemap->nodes[i].flags & NODE_FLAGS_DELETED) {
+ } else if (file_nodemap->nodes[i].flags & NODE_FLAGS_DELETED) {
+ /* Node is being deleted */
DEBUG(DEBUG_NOTICE,
("Node %u is DELETED\n",
nodemap->nodes[i].pnn));
@@ -6315,6 +6321,7 @@ static bool sanity_check_nodes_file_changes(TALLOC_CTX *mem_ctx,
should_abort = true;
}
} else if (nodemap->nodes[i].flags & NODE_FLAGS_DELETED) {
+ /* Node was previously deleted */
DEBUG(DEBUG_NOTICE,
("Node %u is UNDELETED\n", nodemap->nodes[i].pnn));
have_changes = true;