From 1ab91b749c24193d0f9bf65c7e9fe9598f8414cc Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 21 May 2010 14:25:47 +1000 Subject: [PATCH] It was possible for ->recovery_mode to get out of sync with the new three db priorities in such a way that ->recovery_mode was set to normal but database priorities leven2 or 3 was still set to frozen. causing the recovery daemon to fail to detect that a recovery was needed to recover access to the database. BZ63951 --- server/ctdb_control.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/ctdb_control.c b/server/ctdb_control.c index a8785503..ed7324cf 100644 --- a/server/ctdb_control.c +++ b/server/ctdb_control.c @@ -162,7 +162,16 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb, return ctdb_control_push_db(ctdb, indata); case CTDB_CONTROL_GET_RECMODE: { - return ctdb->recovery_mode; + int i; + if (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE) { + return CTDB_RECOVERY_ACTIVE; + } + for (i=1; i<=NUM_DB_PRIORITIES; i++) { + if (ctdb->freeze_mode[i] == CTDB_FREEZE_FROZEN) { + return CTDB_RECOVERY_ACTIVE; + } + } + return CTDB_RECOVERY_NORMAL; } case CTDB_CONTROL_SET_RECMASTER: { -- 2.34.1