ctdbd: call tdb_reopen_all() in freeze child.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 21 Mar 2011 02:37:17 +0000 (13:07 +1030)
committerRonnie Sahlberg <sahlberg@lenovo-laptop.(none)>
Mon, 21 Mar 2011 02:58:02 +0000 (13:58 +1100)
In theory, the ctdbd parent shouldn't be holding any locks, but it's a good
idea to always call tdb_reopen_all() after a fork().

server/ctdb_freeze.c

index 0f70fd35023df539dceab412195cd741fed02a9c..9eb2493088033d90047801b1c50f999d34e597e2 100644 (file)
@@ -204,6 +204,11 @@ static struct ctdb_freeze_handle *ctdb_freeze_lock(struct ctdb_context *ctdb, ui
                close(fd[0]);
 
                debug_extra = talloc_asprintf(NULL, "freeze_lock-%u:", priority);
+               if (tdb_reopen_all(true) != 0) {
+                       DEBUG(DEBUG_ERR,(__location__ " Failed to reopen databases\n"));
+                       _exit(0);
+               }
+
                ret = ctdb_lock_all_databases(ctdb, priority);
                if (ret != 0) {
                        _exit(0);