summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xctdb/config/ctdb.init4
-rw-r--r--ctdb/server/ctdb_recoverd.c12
2 files changed, 14 insertions, 2 deletions
diff --git a/ctdb/config/ctdb.init b/ctdb/config/ctdb.init
index c83c091a73..922a53d57f 100755
--- a/ctdb/config/ctdb.init
+++ b/ctdb/config/ctdb.init
@@ -66,10 +66,10 @@ CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK"
[ -z "$CTDB_START_AS_DISABLED" ] || [ "$CTDB_START_AS_DISABLED" != "yes" ] || {
CTDB_OPTIONS="$CTDB_OPTIONS --start-as-disabled"
}
-[ -z "$CTDB_CAPABILITY_RECMASTER" ] || [ "$CTDB_CAPABILITY_RECMASTER" != "yes" ] || {
+[ -z "$CTDB_CAPABILITY_RECMASTER" ] || [ "$CTDB_CAPABILITY_RECMASTER" != "no" ] || {
CTDB_OPTIONS="$CTDB_OPTIONS --no-recmaster"
}
-[ -z "$CTDB_CAPABILITY_LMASTER" ] || [ "$CTDB_CAPABILITY_LMASTER" != "yes" ] || {
+[ -z "$CTDB_CAPABILITY_LMASTER" ] || [ "$CTDB_CAPABILITY_LMASTER" != "no" ] || {
CTDB_OPTIONS="$CTDB_OPTIONS --no-lmaster"
}
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 3617efd4e2..26993f4f17 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -1481,6 +1481,13 @@ static void ctdb_election_data(struct ctdb_recoverd *rec, struct election_messag
em->num_connected++;
}
}
+
+ /* we shouldnt try to win this election if we cant be a recmaster */
+ if ((ctdb->capabilities & CTDB_CAP_RECMASTER) == 0) {
+ em->num_connected = 0;
+ em->priority_time = timeval_current();
+ }
+
talloc_free(nodemap);
}
@@ -1494,6 +1501,11 @@ static bool ctdb_election_win(struct ctdb_recoverd *rec, struct election_message
ctdb_election_data(rec, &myem);
+ /* we cant win if we dont have the recmaster capability */
+ if ((rec->ctdb->capabilities & CTDB_CAP_RECMASTER) == 0) {
+ return false;
+ }
+
/* we cant win if we are banned */
if (rec->node_flags & NODE_FLAGS_BANNED) {
return false;