diff options
author | Amitay Isaacs <amitay@gmail.com> | 2013-05-29 14:05:50 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-05-29 17:47:16 +1000 |
commit | fe1fc55c616f175a3ebdd8edb64dca0430c149d7 (patch) | |
tree | f09d1b7f8b594412a109442822a6a55f6a639dbd /ctdb/lib/tdb/common/transaction.c | |
parent | 803416d9787361f61d7d0a22618df45d5b7af4f3 (diff) | |
download | samba-fe1fc55c616f175a3ebdd8edb64dca0430c149d7.tar.gz samba-fe1fc55c616f175a3ebdd8edb64dca0430c149d7.tar.xz samba-fe1fc55c616f175a3ebdd8edb64dca0430c149d7.zip |
tdb: Sync to tdb 1.2.11 from upstream
(This used to be ctdb commit bb3a32ec055432afc7225c9fd7504fb187694bda)
Diffstat (limited to 'ctdb/lib/tdb/common/transaction.c')
-rw-r--r-- | ctdb/lib/tdb/common/transaction.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ctdb/lib/tdb/common/transaction.c b/ctdb/lib/tdb/common/transaction.c index c3477eb80ca..f18b4c229eb 100644 --- a/ctdb/lib/tdb/common/transaction.c +++ b/ctdb/lib/tdb/common/transaction.c @@ -82,8 +82,9 @@ intervention. - if TDB_NOSYNC is passed to flags in tdb_open then transactions are - still available, but no transaction recovery area is used and no - fsync/msync calls are made. + still available, but no fsync/msync calls are made. This means we + are still proof against a process dying during transaction commit, + but not against machine reboot. - if TDB_ALLOW_NESTING is passed to flags in tdb open, or added using tdb_add_flags() transaction nesting is enabled. @@ -976,13 +977,11 @@ static int _tdb_transaction_prepare_commit(struct tdb_context *tdb) return -1; } - if (!(tdb->flags & TDB_NOSYNC)) { - /* write the recovery data to the end of the file */ - if (transaction_setup_recovery(tdb, &tdb->transaction->magic_offset) == -1) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_prepare_commit: failed to setup recovery data\n")); - _tdb_transaction_cancel(tdb); - return -1; - } + /* write the recovery data to the end of the file */ + if (transaction_setup_recovery(tdb, &tdb->transaction->magic_offset) == -1) { + TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_prepare_commit: failed to setup recovery data\n")); + _tdb_transaction_cancel(tdb); + return -1; } tdb->transaction->prepared = true; |