1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

cleanup of the previous patch.

With these patches, ctdbd will enforce and (by default) always use
tdb_transactions when updating/writing records to a persistent database.

This might come with a small performance degratation  since transactions
are slower than no transactions at all.

If a client, such as samba wants to use a persistent database but does NOT
want to pay the performance penalty, it can specify TDB_NOSYNC  as the
srvid parameter in the ctdb_control() for CTDB_CONTROL_DB_ATTACH_PERSISTENT.

In this case CTDBD will remember that "this database is not that important"
so I can use unsafe (no transaction) tdb_stores to write the updates.
It will be faster than the default (always use transaction) but less crash safe.

(This used to be ctdb commit 3d85d2cf669686f89cacdc481eaa97aef1ba62c0)
This commit is contained in:
Ronnie Sahlberg 2008-05-22 13:12:53 +10:00
parent ed2cf0291d
commit d895f43504
2 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,7 @@ int ctdb_ltdb_persistent_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
/* if this is a persistent database without NOSYNC then we
will do this via a transaction */
if (ctdb_db->persistent && !(ctdb_db->client_tdb_flags & TDB_NOSYNC)) {
if (!(ctdb_db->client_tdb_flags & TDB_NOSYNC)) {
ret = tdb_transaction_start(ctdb_db->ltdb->tdb);
if (ret != 0) {
DEBUG(DEBUG_ERR, (__location__ " Failed to start local transaction\n"));

View File

@ -262,7 +262,7 @@ int32_t ctdb_control_update_record(struct ctdb_context *ctdb,
state->data.dsize -= sizeof(struct ctdb_ltdb_header);
#if 0
/* We can not take out a lock here pourself since if this persistent
/* We can not take out a lock here ourself since if this persistent
database needs safe transaction writes we can not be holding
a lock on the database.
Therefore we always create a lock wait child to take out and hold