From de9d21957706bd5d811db01b7b5d88a0bb17034b Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 11 Jul 2017 21:35:17 +0200 Subject: [PATCH] dbwrap: Ask CTDB for local tdb open flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891 Signed-off-by: Ralph Boehme Reviewed-by: Amitay Isaacs Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed Jul 12 13:25:11 CEST 2017 on sn-devel-144 --- source3/lib/dbwrap/dbwrap_ctdb.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index 07e35f8ffb0..6bdaab000a9 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -1840,9 +1840,25 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx, result->persistent = persistent; result->lock_order = lock_order; - /* only pass through specific flags */ - tdb_flags &= TDB_SEQNUM|TDB_VOLATILE| - TDB_MUTEX_LOCKING|TDB_CLEAR_IF_FIRST; + data.dptr = (uint8_t *)&db_ctdb->db_id; + data.dsize = sizeof(db_ctdb->db_id); + + ret = ctdbd_control_local(conn, CTDB_CONTROL_DB_OPEN_FLAGS, + 0, 0, data, NULL, &data, &cstatus); + if (ret != 0) { + DBG_ERR(" ctdb control for db_open_flags " + "failed: %s\n", strerror(ret)); + TALLOC_FREE(result); + return NULL; + } + + if (cstatus != 0 || data.dsize != sizeof(int)) { + DBG_ERR("ctdb_control for db_open_flags failed\n"); + TALLOC_FREE(result); + return NULL; + } + + tdb_flags = *(int *)data.dptr; if (!result->persistent) { ret = ctdb_async_ctx_init(NULL, messaging_tevent_context(msg_ctx)); -- 2.11.4.GIT