ctdb-recoverd: New function ctdb_recovery_unlock()
[vlendec/samba-autobuild/.git] / ctdb / server / ctdb_recover.c
index 1f1e50aa29293e70f6e13583a6ca52407ca43a29..a4d84fd1a753a22cfb8a7e623c9dc09bc6392b9e 100644 (file)
@@ -784,6 +784,15 @@ bool ctdb_recovery_lock(struct ctdb_context *ctdb, bool keep)
        return true;
 }
 
+void ctdb_recovery_unlock(struct ctdb_context *ctdb)
+{
+       if (ctdb->recovery_lock_fd != -1) {
+               DEBUG(DEBUG_NOTICE, ("Releasing recovery lock\n"));
+               close(ctdb->recovery_lock_fd);
+               ctdb->recovery_lock_fd = -1;
+       }
+}
+
 /*
   delete a record as part of the vacuum process
   only delete if we are not lmaster or dmaster, and our rsn is <= the provided rsn