ctdb-recoverd: Remove redundant condition when checking recovery lock
authorMartin Schwenke <martin@meltin.net>
Tue, 31 Mar 2015 02:59:49 +0000 (13:59 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 10 May 2015 01:22:13 +0000 (03:22 +0200)
It isn't possible to hold the recovery lock without having a lock file
set.

This is part of a goal to generalise the recovery lock mechanism to
just use a helper program, which may use a lock file or may use
something else.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index e0eb7d60b660a650759f5c32f7eda478b13e30cb..e76a0d02b9c1b078e44c7fd71704740ab547bfd9 100644 (file)
@@ -2745,12 +2745,10 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
        /* we didn't win */
        TALLOC_FREE(rec->send_election_te);
 
-        if (ctdb->recovery_lock_file != NULL) {
-               /* Release the recovery lock file */
-               if (ctdb_recovery_have_lock(ctdb)) {
-                       ctdb_recovery_unlock(ctdb);
-                       unban_all_nodes(ctdb);
-               }
+       /* Release the recovery lock file */
+       if (ctdb_recovery_have_lock(ctdb)) {
+               ctdb_recovery_unlock(ctdb);
+               unban_all_nodes(ctdb);
        }
 
        /* ok, let that guy become recmaster then */