summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_monitor.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-10-09 15:47:49 +0200
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-26 14:21:45 +1100
commit198866d82d4487f6d45104e051ca94b8072a21f2 (patch)
tree0dcc052af97fedb4f8ceeef9a62ae5ab0977e4d2 /ctdb/server/ctdb_monitor.c
parent7a616a0d7b5c0b83822a3c0084c0dc82060b546a (diff)
downloadsamba-198866d82d4487f6d45104e051ca94b8072a21f2.tar.gz
samba-198866d82d4487f6d45104e051ca94b8072a21f2.tar.xz
samba-198866d82d4487f6d45104e051ca94b8072a21f2.zip
server: if takeover runs when the recovery master becomes unhealthy
The problem was this: When the monitor event fails, the node->flags get updated, and an update (containing the old and new flags) is sent to the recovery master. If the recovery master sends the update to itself (the same process), it was compairing the node->flags variable with the received new flags. This check always found both flag values to be equal and never sets the rec->need_takeover_run variable to true. There were two problem, first the push_flags_handler() function didn't pass the received old flags. And the ctdb_control_modflags() function ignored the received old flags. metze (This used to be ctdb commit 8ec633b64a05a2d903c2b9639909f15f6375548f)
Diffstat (limited to 'ctdb/server/ctdb_monitor.c')
-rw-r--r--ctdb/server/ctdb_monitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index 056d8311150..89975350544 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -342,7 +342,9 @@ int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata)
node = ctdb->nodes[c->pnn];
old_flags = node->flags;
- c->old_flags = node->flags;
+ if (c->pnn != ctdb->pnn) {
+ c->old_flags = node->flags;
+ }
node->flags = c->new_flags & ~NODE_FLAGS_DISCONNECTED;
node->flags |= (c->old_flags & NODE_FLAGS_DISCONNECTED);