diff options
author | Amitay Isaacs <amitay@gmail.com> | 2016-02-11 14:32:34 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2016-02-11 08:01:14 +0100 |
commit | 19a411f839c5c34fec2aa5e6cb095346be56d94e (patch) | |
tree | 5d4b9f2a699f2bdf052813d6dd8598108fb63a51 /ctdb/server/ctdb_recovery_helper.c | |
parent | dcf6a606cfa5321fdabedb6d535d3b4353993898 (diff) | |
download | samba-19a411f839c5c34fec2aa5e6cb095346be56d94e.tar.gz |
ctdb-recovery: Create recovery databases in state dir
This matches the behaviour during serial database recovery.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Feb 11 08:01:14 CET 2016 on sn-devel-144
Diffstat (limited to 'ctdb/server/ctdb_recovery_helper.c')
-rw-r--r-- | ctdb/server/ctdb_recovery_helper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c index d7288e2d1d2..8fc27916739 100644 --- a/ctdb/server/ctdb_recovery_helper.c +++ b/ctdb/server/ctdb_recovery_helper.c @@ -80,6 +80,7 @@ static struct recdb_context *recdb_create(TALLOC_CTX *mem_ctx, uint32_t db_id, const char *db_path, uint32_t hash_size, bool persistent) { + static char *db_dir_state = NULL; struct recdb_context *recdb; unsigned int tdb_flags; @@ -88,10 +89,16 @@ static struct recdb_context *recdb_create(TALLOC_CTX *mem_ctx, uint32_t db_id, return NULL; } + if (db_dir_state == NULL) { + db_dir_state = getenv("CTDB_DBDIR_STATE"); + } + recdb->db_name = db_name; recdb->db_id = db_id; recdb->db_path = talloc_asprintf(recdb, "%s/recdb.%s", - dirname(discard_const(db_path)), + db_dir_state != NULL ? + db_dir_state : + dirname(discard_const(db_path)), db_name); if (recdb->db_path == NULL) { talloc_free(recdb); |