1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-tools: There is no need for forcing a recovery

This effectively reverts commit 442953c540.
The correct way of telling recovery daemon to trigger a database recovery is
by setting recovery mode to active.  There is no need to freeze databases as
recovery master will do that across the cluster anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2014-05-06 14:15:45 +10:00 committed by Martin Schwenke
parent e5cd81da77
commit 72c6500ee4

View File

@ -3463,23 +3463,10 @@ static int control_recover(struct ctdb_context *ctdb, int argc, const char **arg
{
int ret;
uint32_t generation, next_generation;
bool force;
/* "force" option ignores freeze failure and forces recovery */
force = (argc == 1) && (strcasecmp(argv[0], "force") == 0);
/* record the current generation number */
generation = get_generation(ctdb);
ret = ctdb_ctrl_freeze_priority(ctdb, TIMELIMIT(), options.pnn, 1);
if (ret != 0) {
if (!force) {
DEBUG(DEBUG_ERR, ("Unable to freeze node\n"));
return ret;
}
DEBUG(DEBUG_WARNING, ("Unable to freeze node but proceeding because \"force\" option given\n"));
}
ret = ctdb_ctrl_setrecmode(ctdb, TIMELIMIT(), options.pnn, CTDB_RECOVERY_ACTIVE);
if (ret != 0) {
DEBUG(DEBUG_ERR, ("Unable to set recovery mode\n"));