[SCM] CTDB repository - branch 2.5 updated - ctdb-2.5.3-81-gf2dcea1

Amitay Isaacs amitay at samba.org
Tue Jul 8 19:27:18 MDT 2014


The branch, 2.5 has been updated
       via  f2dcea106f586c3151584d5bb7ef1cbcaa6dee88 (commit)
       via  331d587260a73d3088a38c70f748ded5d8f838c8 (commit)
       via  f7b2dcc2fcaab6fe1a6233aa6fd4b1ed73b551f5 (commit)
       via  7125d461c920719f773ae694589e4802c6ed21ff (commit)
       via  7d038d82960f5ec0ce1b835e9293be9943c56ac3 (commit)
       via  84752cb98158c96586f0f6f5801cfa74a94f9369 (commit)
       via  0a2f1008d119b02233c787b1bf29d2c3bed0cd2d (commit)
       via  310b87d2e42b1120ba63c85024b784b12ed34646 (commit)
       via  e843fe51fc934ded9fed7e5ba8cf1199b8f4d6e5 (commit)
       via  7965f38248be6faaee3591c56290ae809d5913ee (commit)
      from  9455d80a14588cce58ca494725a4eb031ae34e14 (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=2.5


- Log -----------------------------------------------------------------
commit f2dcea106f586c3151584d5bb7ef1cbcaa6dee88
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue May 6 17:44:24 2014 +1000

    tests: Add a test for ctdb restoredb
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Mon Jul  7 16:06:39 CEST 2014 on sn-devel-104
    
    (Imported from commit eccce073d084eceb4bfb5c25001b5873e2c0f2b2)

commit 331d587260a73d3088a38c70f748ded5d8f838c8
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue May 6 17:16:19 2014 +1000

    tests: Check that ctdb wipedb cleans the database
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 9c8c8a7b0bfd4c1cafa3deaa012049b7f0851617)

commit f7b2dcc2fcaab6fe1a6233aa6fd4b1ed73b551f5
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue May 6 14:20:44 2014 +1000

    daemon: Do not thaw databases if recovery is active
    
    This prevents ctdb tool from thawing databases prematurely in
    thaw/wipedb/restoredb commands if recovery is active.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 2855173dac5386bff655d1bb94c1848591b963e1)

commit 7125d461c920719f773ae694589e4802c6ed21ff
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue May 6 14:24:52 2014 +1000

    recoverd: Set recovery mode before freezing databases
    
    Setting recovery mode to active is the only correct way to inform recovery
    daemon to run database recovery.  Only freezing databases without setting
    recovery mode should not trigger database recovery, as this mechanism
    is used in tool to implement wipedb/restoredb commands.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 28a1b75886fb4aea65e23bfd00b9f4c98780fdfd)

commit 7d038d82960f5ec0ce1b835e9293be9943c56ac3
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue May 6 14:15:45 2014 +1000

    tools: There is no need for forcing a recovery
    
    This effectively reverts commit 442953c540424ad0c64f4264b5ee27c45a3130e8.
    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 at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit 72c6500ee440779819b9adb768a7022cc251f07e)

commit 84752cb98158c96586f0f6f5801cfa74a94f9369
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue May 6 14:07:00 2014 +1000

    Revert "It was possible for ->recovery_mode to get out of sync with the new three db priorities in such a way that"
    
    This reverts commit 6578a97bd94fc14d5b6df85b84e50447f7bdb2e3.
    
    This condition cannot happen since when recovery is triggered, all the
    databases would get frozen and thawed in the order of priority.  The only
    other place where databases get frozen are for implementation of ctdb
    wipedb/restoredb commands.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    (Imported from commit e5cd81da77ef58992b7eb9ff7d972b499b946bb7)

commit 0a2f1008d119b02233c787b1bf29d2c3bed0cd2d
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat May 31 14:01:53 2014 +1000

    common: Use SCHED_RESET_ON_FORK when setting SCHED_FIFO
    
    This makes the scheduler reset code a no-op.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Mon Jul  7 13:28:25 CEST 2014 on sn-devel-104
    
    (Imported from commit 1be8564e553ce044426dbe7b3987edf514832940)

commit 310b87d2e42b1120ba63c85024b784b12ed34646
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 20 13:36:25 2014 +1000

    recoverd: Don't say "Election timed out"
    
    That makes people think there's a problem (and report bugs) so say
    something a bit less scary instead...
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit a283b9e43a602b9c72065336edbe8ad7c2499117)

commit e843fe51fc934ded9fed7e5ba8cf1199b8f4d6e5
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 20 10:51:16 2014 +1000

    recoverd: Log a message when releasing the recovery lock
    
    It is a non-trivial event and will make it easier to debug recovery
    lock issues.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 8bdb9b85cc02f589a3b219de07f3c2ef7510d937)

commit 7965f38248be6faaee3591c56290ae809d5913ee
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jun 26 10:36:17 2014 +1000

    scripts: Support NFS on RHEL7 with systemd
    
    Need to be able to recognise a RHEL system.  Still use "system" to
    start and stop service, since that still works and yields the smallest
    change.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 61b1fdec2fdb19be9b9cd39bc5298917e914cc04)

-----------------------------------------------------------------------

Summary of changes:
 common/system_util.c              |    8 ++-
 config/functions                  |    6 +-
 include/ctdb_private.h            |    3 +-
 server/ctdb_banning.c             |    2 +-
 server/ctdb_control.c             |   13 +----
 server/ctdb_freeze.c              |   13 +++-
 server/ctdb_recover.c             |    2 +-
 server/ctdb_recoverd.c            |   45 +++++++-------
 tests/simple/58_ctdb_restoredb.sh |  118 +++++++++++++++++++++++++++++++++++++
 tests/simple/71_ctdb_wipedb.sh    |   10 +++
 tools/ctdb.c                      |   13 ----
 11 files changed, 178 insertions(+), 55 deletions(-)
 create mode 100755 tests/simple/58_ctdb_restoredb.sh


Changeset truncated at 500 lines:

diff --git a/common/system_util.c b/common/system_util.c
index 6a5f454..fe0f403 100644
--- a/common/system_util.c
+++ b/common/system_util.c
@@ -59,10 +59,14 @@ void set_scheduler(void)
 #else /* no AIX */
 #if HAVE_SCHED_SETSCHEDULER
 	struct sched_param p;
+	int policy = SCHED_FIFO;
 
 	p.sched_priority = 1;
 
-	if (sched_setscheduler(0, SCHED_FIFO, &p) == -1) {
+#ifdef SCHED_RESET_ON_FORK
+	policy |= SCHED_RESET_ON_FORK;
+#endif
+	if (sched_setscheduler(0, policy, &p) == -1) {
 		DEBUG(DEBUG_CRIT,("Unable to set scheduler to SCHED_FIFO (%s)\n",
 			 strerror(errno)));
 	} else {
@@ -92,6 +96,7 @@ void reset_scheduler(void)
 #endif
 #else /* no AIX */
 #if HAVE_SCHED_SETSCHEDULER
+#ifndef SCHED_RESET_ON_FORK
 	struct sched_param p;
 
 	p.sched_priority = 0;
@@ -100,6 +105,7 @@ void reset_scheduler(void)
 	}
 #endif
 #endif
+#endif
 }
 
 void set_nonblocking(int fd)
diff --git a/config/functions b/config/functions
index 1bcdc34..9617047 100755
--- a/config/functions
+++ b/config/functions
@@ -681,7 +681,8 @@ startstop_nfs() {
 	[ -x $CTDB_ETCDIR/init.d/nfsserver ] && {
 		PLATFORM="sles"
 	}
-	[ -x $CTDB_ETCDIR/init.d/nfslock ] && {
+	[ -x $CTDB_ETCDIR/init.d/nfslock -o \
+	    -r /usr/lib/systemd/system/nfs-lock.service ] && {
 		PLATFORM="rhel"
 	}
 
@@ -761,7 +762,8 @@ startstop_nfslock() {
 	[ -x $CTDB_ETCDIR/init.d/nfsserver ] && {
 		PLATFORM="sles"
 	}
-	[ -x $CTDB_ETCDIR/init.d/nfslock ] && {
+	[ -x $CTDB_ETCDIR/init.d/nfslock -o \
+	    -r /usr/lib/systemd/system/nfs-lock.service ] && {
 		PLATFORM="rhel"
 	}
 
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index de7880b..aeebed1 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -1059,7 +1059,8 @@ void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_contr
 				TDB_DATA *outdata, int32_t status, const char *errormsg);
 
 int32_t ctdb_control_freeze(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply);
-int32_t ctdb_control_thaw(struct ctdb_context *ctdb, uint32_t priority);
+int32_t ctdb_control_thaw(struct ctdb_context *ctdb, uint32_t priority,
+			  bool check_recmode);
 
 int ctdb_start_recoverd(struct ctdb_context *ctdb);
 void ctdb_stop_recoverd(struct ctdb_context *ctdb);
diff --git a/server/ctdb_banning.c b/server/ctdb_banning.c
index 13d97c8..a9d1891 100644
--- a/server/ctdb_banning.c
+++ b/server/ctdb_banning.c
@@ -70,11 +70,11 @@ void ctdb_local_node_got_banned(struct ctdb_context *ctdb)
 	*/
 	ctdb->vnn_map->generation = INVALID_GENERATION;
 
+	ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
 	for (i=1; i<=NUM_DB_PRIORITIES; i++) {
 		ctdb_start_freeze(ctdb, i);
 	}
 	ctdb_release_all_ips(ctdb);
-	ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
 }
 
 int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
diff --git a/server/ctdb_control.c b/server/ctdb_control.c
index b0220de..1f9e4bc 100644
--- a/server/ctdb_control.c
+++ b/server/ctdb_control.c
@@ -198,16 +198,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 		return ctdb_control_push_db(ctdb, indata);
 
 	case CTDB_CONTROL_GET_RECMODE: {
-		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;
+		return ctdb->recovery_mode;
 	}
 
 	case CTDB_CONTROL_SET_RECMASTER: {
@@ -327,7 +318,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 
 	case CTDB_CONTROL_THAW:
 		CHECK_CONTROL_DATA_SIZE(0);
-		return ctdb_control_thaw(ctdb, (uint32_t)c->srvid);
+		return ctdb_control_thaw(ctdb, (uint32_t)c->srvid, true);
 
 	case CTDB_CONTROL_SET_RECMODE:
 		CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));		
diff --git a/server/ctdb_freeze.c b/server/ctdb_freeze.c
index fee44d4..42a1285 100644
--- a/server/ctdb_freeze.c
+++ b/server/ctdb_freeze.c
@@ -267,11 +267,18 @@ static void thaw_priority(struct ctdb_context *ctdb, uint32_t priority)
 /*
   thaw the databases
  */
-int32_t ctdb_control_thaw(struct ctdb_context *ctdb, uint32_t priority)
+int32_t ctdb_control_thaw(struct ctdb_context *ctdb, uint32_t priority,
+			  bool check_recmode)
 {
-
 	if (priority > NUM_DB_PRIORITIES) {
-		DEBUG(DEBUG_ERR,(__location__ " Invalid db priority : %u\n", priority));
+		DEBUG(DEBUG_ERR,(__location__ " Invalid db priority : %u\n",
+				 priority));
+		return -1;
+	}
+
+	if (check_recmode && ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE) {
+		DEBUG(DEBUG_ERR, ("Failing to thaw databases while "
+				  "recovery is active\n"));
 		return -1;
 	}
 
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 7249f50..aa6abbe 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -623,7 +623,7 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
 	/* force the databases to thaw */
 	for (i=1; i<=NUM_DB_PRIORITIES; i++) {
 		if (ctdb->freeze_handles[i] != NULL) {
-			ctdb_control_thaw(ctdb, i);
+			ctdb_control_thaw(ctdb, i, false);
 		}
 	}
 
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index cfba29d..ab73e88 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -379,8 +379,23 @@ static int set_recovery_mode(struct ctdb_context *ctdb, struct ctdb_recoverd *re
 	tmp_ctx = talloc_new(ctdb);
 	CTDB_NO_MEMORY(ctdb, tmp_ctx);
 
-	/* freeze all nodes */
 	nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true);
+
+	data.dsize = sizeof(uint32_t);
+	data.dptr = (unsigned char *)&rec_mode;
+
+	if (ctdb_client_async_control(ctdb, CTDB_CONTROL_SET_RECMODE,
+					nodes, 0,
+					CONTROL_TIMEOUT(),
+					false, data,
+					NULL, NULL,
+					NULL) != 0) {
+		DEBUG(DEBUG_ERR, (__location__ " Unable to set recovery mode. Recovery failed.\n"));
+		talloc_free(tmp_ctx);
+		return -1;
+	}
+
+	/* freeze all nodes */
 	if (rec_mode == CTDB_RECOVERY_ACTIVE) {
 		int i;
 
@@ -399,21 +414,6 @@ static int set_recovery_mode(struct ctdb_context *ctdb, struct ctdb_recoverd *re
 		}
 	}
 
-
-	data.dsize = sizeof(uint32_t);
-	data.dptr = (unsigned char *)&rec_mode;
-
-	if (ctdb_client_async_control(ctdb, CTDB_CONTROL_SET_RECMODE,
-					nodes, 0,
-					CONTROL_TIMEOUT(),
-					false, data,
-					NULL, NULL,
-					NULL) != 0) {
-		DEBUG(DEBUG_ERR, (__location__ " Unable to set recovery mode. Recovery failed.\n"));
-		talloc_free(tmp_ctx);
-		return -1;
-	}
-
 	talloc_free(tmp_ctx);
 	return 0;
 }
@@ -1168,7 +1168,7 @@ static void ctdb_election_timeout(struct event_context *ev, struct timed_event *
 	rec->election_timeout = NULL;
 	fast_start = false;
 
-	DEBUG(DEBUG_WARNING,(__location__ " Election timed out\n"));
+	DEBUG(DEBUG_WARNING,("Election period ended\n"));
 }
 
 
@@ -2716,6 +2716,7 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
 		/* release the recmaster lock */
 		if (em->pnn != ctdb->pnn &&
 		    ctdb->recovery_lock_fd != -1) {
+			DEBUG(DEBUG_NOTICE, ("Release the recovery lock\n"));
 			close(ctdb->recovery_lock_fd);
 			ctdb->recovery_lock_fd = -1;
 			unban_all_nodes(ctdb);
@@ -3653,17 +3654,17 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 		if (ctdb->recovery_mode == CTDB_RECOVERY_NORMAL) {
 			DEBUG(DEBUG_ERR,("Node is stopped or banned but recovery mode is not active. Activate recovery mode and lock databases\n"));
 
-			ret = ctdb_ctrl_freeze_priority(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, 1);
-			if (ret != 0) {
-				DEBUG(DEBUG_ERR,(__location__ " Failed to freeze node in STOPPED or BANNED state\n"));
-				return;
-			}
 			ret = ctdb_ctrl_setrecmode(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, CTDB_RECOVERY_ACTIVE);
 			if (ret != 0) {
 				DEBUG(DEBUG_ERR,(__location__ " Failed to activate recovery mode in STOPPED or BANNED state\n"));
 
 				return;
 			}
+			ret = ctdb_ctrl_freeze(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE);
+			if (ret != 0) {
+				DEBUG(DEBUG_ERR,(__location__ " Failed to freeze node in STOPPED or BANNED state\n"));
+				return;
+			}
 		}
 
 		/* If this node is stopped or banned then it is not the recovery
diff --git a/tests/simple/58_ctdb_restoredb.sh b/tests/simple/58_ctdb_restoredb.sh
new file mode 100755
index 0000000..31b81a6
--- /dev/null
+++ b/tests/simple/58_ctdb_restoredb.sh
@@ -0,0 +1,118 @@
+#!/bin/bash
+
+test_info()
+{
+    cat <<EOF
+The command 'ctdb restoredb' is used to restore a database across the
+whole cluster.
+
+Prerequisites:
+
+* An active CTDB cluster with at least 2 active nodes.
+
+Steps:
+
+1. Verify that the status on all of the ctdb nodes is 'OK'.
+2. Create a persistent test database
+3. Add some records to test database
+4. Backup database
+5. Wipe database and verify the database is empty on all nodes
+6. Restore database and make sure all the records are restored
+7. Make sure no recovery has been triggered
+
+Expected results:
+
+* Database operations should not cause a recovery
+
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+cluster_is_healthy
+
+try_command_on_node 0 $CTDB status
+generation=$(echo "$out" | sed -n -e 's/^Generation:\([0-9]*\)/\1/p')
+
+try_command_on_node 0 "$CTDB listnodes"
+num_nodes=$(echo "$out" | wc -l)
+
+# 2.
+test_db="restoredb_test.tdb"
+test_dump=$(mktemp)
+echo $test_dump
+echo "Create persistent test database \"$test_db\""
+try_command_on_node 0 $CTDB attach "$test_db" persistent
+try_command_on_node 0 $CTDB wipedb "$test_db"
+
+# 3.
+# add 10,000 records to database
+echo "Adding 10000 records to database"
+(
+for i in $(seq 1 10000) ; do
+	echo "\"key$i\" \"value$i\""
+done
+) | try_command_on_node -i 0 $CTDB ptrans "$test_db"
+
+num_records=$(db_ctdb_cattdb_count_records 1 "$test_db")
+if [ $num_records = "10000" ] ; then
+    echo "OK: Records added"
+else
+    echo "BAD: We did not end up with 10000 records"
+    echo "num records = $num_records"
+    exit 1
+fi
+
+ctdb_test_exit_hook_add "rm -f $test_dump"
+
+# 4.
+echo "Backup database"
+try_command_on_node 0 $CTDB backupdb "$test_db" "$test_dump"
+
+# 5.
+echo "Wipe database"
+try_command_on_node 0 $CTDB wipedb "$test_db"
+
+# check that the database is restored
+num_records=$(db_ctdb_cattdb_count_records 1 "$test_db")
+if [ $num_records = "0" ] ; then
+    echo "OK: Database was wiped"
+else
+    echo "BAD: We did not end up with an empty database"
+    echo "num records = $num_records"
+    exit 1
+fi
+
+# 6.
+echo "Restore database"
+try_command_on_node 0 $CTDB restoredb "$test_dump" "$test_db"
+
+# check that the database is restored
+num_records=$(db_ctdb_cattdb_count_records 1 "$test_db")
+if [ $num_records = "10000" ] ; then
+    echo "OK: Database was restored"
+else
+    echo "BAD: We did not end up with 10000 records"
+    echo "num records = $num_records"
+    exit 1
+fi
+
+# 7.
+wait_until_ready
+
+try_command_on_node 0 $CTDB status
+new_generation=$(echo "$out" | sed -n -e 's/^Generation:\([0-9]*\)/\1/p')
+
+echo "Old generation = $generation"
+echo "New generation = $new_generation"
+
+if [ "$generation" = "$new_generation" ]; then
+    echo "OK: Database recovery not triggered."
+else
+    echo "BAD: Database recovery triggered."
+    exit 1
+fi
diff --git a/tests/simple/71_ctdb_wipedb.sh b/tests/simple/71_ctdb_wipedb.sh
index 886e5e6..1919ea7 100755
--- a/tests/simple/71_ctdb_wipedb.sh
+++ b/tests/simple/71_ctdb_wipedb.sh
@@ -52,6 +52,16 @@ db_ctdb_tstore 1 "$test_db" "DEF" "DEF"
 # 4.
 echo "Wipe database"
 try_command_on_node 0 $CTDB wipedb "$test_db"
+
+# check that the database is wiped
+num_records=$(db_ctdb_cattdb_count_records 1 "$test_db")
+if [ $num_records = "0" ] ; then
+    echo "OK: Database was wiped"
+else
+    echo "BAD: We did not end up with an empty database"
+    exit 1
+fi
+
 echo "Force a recovery"
 try_command_on_node 0 $CTDB recover
 
diff --git a/tools/ctdb.c b/tools/ctdb.c
index dc505c9..594bfa6 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -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"));


-- 
CTDB repository


More information about the samba-cvs mailing list