dbwrap_ctdb: only fetch a read-only copy if we had a record already.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 3 Feb 2012 00:00:54 +0000 (11:00 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 5 Mar 2012 00:11:26 +0000 (01:11 +0100)
commit5bda06877303b4ac01081b12f889db1409c0a6f6
treeced934126e83567cf7d7f4539173c694d57e3a7f
parent67bb5abe81dc64758a792060673b923cd77a018a
dbwrap_ctdb: only fetch a read-only copy if we had a record already.

Because revoking read-only copies of records is expensive, we only
want ctdbd to do it for high-turnover records.  A basic heuristic is
that if we don't find a local copy of the record, don't ask for a
read-only copy.

The fetch itself will cause ctdbd to migrate the record, so eventually
we will have a local copy.  Next time it gets migrated away, we'll
call ctdbd_fetch() with local_copy = true.

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