summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap/dbwrap_ctdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_ctdb.c')
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 0f4efa359c..a05f9554b7 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1203,9 +1203,14 @@ static NTSTATUS db_ctdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
SAFE_FREE(ctdb_data.dptr);
- /* we weren't able to get it locally - ask ctdb to fetch it for us */
+ /*
+ * We weren't able to get it locally - ask ctdb to fetch it for us.
+ * If we already had *something*, it's probably worth making a local
+ * read-only copy.
+ */
status = ctdbd_fetch(messaging_ctdbd_connection(), ctx->db_id, key,
- mem_ctx, data);
+ mem_ctx, data,
+ ctdb_data.dsize >= sizeof(struct ctdb_ltdb_header));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(5, ("ctdbd_fetch failed: %s\n", nt_errstr(status)));
}