ctdbd_conn: fetch read-only copies of records.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 2 Feb 2012 23:54:53 +0000 (10:54 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 5 Mar 2012 00:11:26 +0000 (01:11 +0100)
This means we try to get a read-only copy of a record, which we can
then place in the local tdb.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/lib/ctdbd_conn.c

index 9c73002..f160fd6 100644 (file)
@@ -1391,7 +1391,7 @@ NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32 db_id,
 }
 
 /*
- * remotely fetch a record without locking it or forcing a migration
+ * remotely fetch a record (read-only)
  */
 NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id,
                     TDB_DATA key, TALLOC_CTX *mem_ctx, TDB_DATA *data)
@@ -1407,7 +1407,7 @@ NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id,
        req.hdr.ctdb_version = CTDB_VERSION;
        req.hdr.operation    = CTDB_REQ_CALL;
        req.hdr.reqid        = ctdbd_next_reqid(conn);
-       req.flags            = 0;
+       req.flags            = CTDB_WANT_READONLY;
        req.callid           = CTDB_FETCH_FUNC;
        req.db_id            = db_id;
        req.keylen           = key.dsize;