[PATCH] Clean up tdb flags calculation in CTDB

Amitay Isaacs amitay at gmail.com
Mon Jun 26 01:58:42 UTC 2017


Hi,

CTDB's database attach controls were designed to pass the tdb open flags.
It means that clients (including samba) have to calculate the tdb flags
before opening to a clustered database exactly the same way as calculated
by ctdb daemon.  This is counter-intuitive and prone to errors specially
when robust mutexes are involved.  Once a clustered database is opened, all
the clients have to match the flags to attach to that clustered database.

This patch set cleans up database code in ctdb daemon and refactors the
logic to calculate tdb open flags in one place.  For clients to know the
correct tdb flags to use while opening the database locally, a new control
is added which returns tdb_flags.  This avoids the need to pass any
tdb_flags with DB_ATTACH controls and hence the flags are now ignored.

Please review and push.

Amitay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctdb.patch
Type: text/x-patch
Size: 47691 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170626/2e5b7736/ctdb.bin>


More information about the samba-technical mailing list