dbwrap_ctdb: handle read-only records.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 2 Feb 2012 23:53:27 +0000 (10:53 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 5 Mar 2012 00:11:26 +0000 (01:11 +0100)
commita3e6f550657f2b71634ae87f0d8c7bd9e6eef921
tree4296173d751b699d6378272e9e73e3cf6b5fb586
parentc23b2bdea1549af661dc483c1fb4a7ce0d8f2982
dbwrap_ctdb: handle read-only records.

The new read-only record flags make determining if we can use a record
a bit more complex, so extract it into its own function.

The OLD logic was:
1) If the record doesn't exist, we can't use it.
2) If we are the dmaster for the record, we can use it.

The new logic is:
1) If the record doesn't exist, we can't use it.
2) If we are the dmaster for the record, we can use it IF we only
   want read-only access, OR there are no read-only delegations.
3) If we are not dmaster, we can only use it if we want read-only
   access and it is marked as a read-only copy.

This logic is unused until the next patches which begin to ask
for read-only copies of records.

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