Try to use tdb transactions when updating a record and record header inside the ctdb...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 12 May 2008 03:37:31 +0000 (13:37 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 12 May 2008 03:37:31 +0000 (13:37 +1000)
commit8d6ecf47318188448d934ab76e40da7e4cece67d
tree43241a590c2d8b71060460b00ffcd314c15ea962
parent423a2b0965ed6aaaf1dce8864a07ed93944bcf16
Try to use tdb transactions when updating a record and record header inside the ctdb daemon.

If a transaction could be started, do safe transaction store when updating the record inside the daemon.
If the transaction could not be started (maybe another samba process has a lock on the database?) then just do a normal store instead (instead of blocking the ctdb daemon).

The client can "signal" ctdb that updates to this database should, if possible, be done using safe transactions by specifying the TDB_NOSYNC flag when attaching to the database.
The TDB flags are passed to ctdb in the "srvid" field of the control header when attaching using the CTDB_CONTROL_DB_ATTACH_PERSISTENT.

Currently, samba3.2 does not yet tell ctdbd to handle any persistent databases using safe transactions.

If samba3.2 wants a particular persistent database to be handled using
safe transactions inside the ctdbd daemon, it should pass
TDB_NOSYNC as the flags to the call to attach to a persistent database
in ctdbd_db_attach()     it currently specifies 0 as the srvid
common/ctdb_ltdb.c
include/ctdb_private.h
server/ctdb_control.c
server/ctdb_ltdb_server.c