summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_recoverd.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-09-26 13:11:04 +1000
committerMartin Schwenke <martin@meltin.net>2013-10-22 11:49:54 +1100
commit4812291ff843a67dbe3e7d26930fd2e7f4b2cbb0 (patch)
tree343acf8eb4854cce6bebd99c462d41bd8b3771cd /ctdb/server/ctdb_recoverd.c
parentec7c9952d555d747f35306c82978e930dee04ee1 (diff)
downloadsamba-4812291ff843a67dbe3e7d26930fd2e7f4b2cbb0.tar.gz
samba-4812291ff843a67dbe3e7d26930fd2e7f4b2cbb0.tar.xz
samba-4812291ff843a67dbe3e7d26930fd2e7f4b2cbb0.zip
recoverd: Fix the VNN lmaster consistency check
It does cope with node that don't have the lmaster capability. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 588172bcb6bf267339e2bd09e23d2c4904a27a41)
Diffstat (limited to 'ctdb/server/ctdb_recoverd.c')
-rw-r--r--ctdb/server/ctdb_recoverd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 2e8ba589605..86a4d85dc52 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -129,6 +129,7 @@ struct ctdb_recoverd {
struct ctdb_context *ctdb;
uint32_t recmaster;
uint32_t num_active;
+ uint32_t num_lmasters;
uint32_t num_connected;
uint32_t last_culprit_node;
struct ctdb_node_map *nodemap;
@@ -3701,10 +3702,14 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
/* count how many active nodes there are */
rec->num_active = 0;
+ rec->num_lmasters = 0;
rec->num_connected = 0;
for (i=0; i<nodemap->num; i++) {
if (!(nodemap->nodes[i].flags & NODE_FLAGS_INACTIVE)) {
rec->num_active++;
+ if (rec->ctdb->nodes[i]->capabilities & CTDB_CAP_LMASTER) {
+ rec->num_lmasters++;
+ }
}
if (!(nodemap->nodes[i].flags & NODE_FLAGS_DISCONNECTED)) {
rec->num_connected++;
@@ -3952,12 +3957,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
}
- /* there better be the same number of lmasters in the vnn map
- as there are active nodes or we will have to do a recovery
+ /* There must be the same number of lmasters in the vnn map as
+ * there are active nodes with the lmaster capability... or
+ * do a recovery.
*/
- if (vnnmap->size != rec->num_active) {
- DEBUG(DEBUG_ERR, (__location__ " The vnnmap count is different from the number of active nodes. %u vs %u\n",
- vnnmap->size, rec->num_active));
+ if (vnnmap->size != rec->num_lmasters) {
+ DEBUG(DEBUG_ERR, (__location__ " The vnnmap count is different from the number of active lmaster nodes: %u vs %u\n",
+ vnnmap->size, rec->num_lmasters));
ctdb_set_culprit(rec, ctdb->pnn);
do_recovery(rec, mem_ctx, pnn, nodemap, vnnmap);
return;