summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_recoverd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 33df06f2720..5e49e8842d9 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -978,6 +978,20 @@ static void ctdb_recovery_unlock(struct ctdb_recoverd *rec)
return;
}
+ if (! rec->recovery_lock_handle->done) {
+ /*
+ * Taking of recovery lock still in progress. Free
+ * the cluster mutex handle to release it but leave
+ * the recovery lock handle in place to allow taking
+ * of the lock to fail.
+ */
+ D_NOTICE("Cancelling recovery lock\n");
+ TALLOC_FREE(rec->recovery_lock_handle->h);
+ rec->recovery_lock_handle->done = true;
+ rec->recovery_lock_handle->locked = false;
+ return;
+ }
+
D_NOTICE("Releasing recovery lock\n");
TALLOC_FREE(rec->recovery_lock_handle);
}