summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-15 14:04:22 -0700
committerStefan Metzmacher <metze@samba.org>2009-12-16 08:03:46 +0100
commit09f7874151435868a1854747f3c49e48d0726d72 (patch)
treef6cf804fed157eef2bf229c31a353f73012eafe2
parentd05b49aaf287fd107627ce9df4aaa0bc0b5068b0 (diff)
downloadsamba-09f7874151435868a1854747f3c49e48d0726d72.tar.gz
samba-09f7874151435868a1854747f3c49e48d0726d72.tar.xz
samba-09f7874151435868a1854747f3c49e48d0726d72.zip
tdb: allow reads after prepare commit
We previously only allowed a commit to happen after a prepare commit. It is in fact safe to allow reads between a prepare and a commit, and the s4 replication code can make use of that, so allow it. (cherry picked from samba commit 46c99ec2a3781d53138245182345c6c2ddd9a258) Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be ctdb commit 5ef5ddb8369e5e76173285fe9a08498dc8dc73ab)
-rw-r--r--ctdb/lib/tdb/common/transaction.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/ctdb/lib/tdb/common/transaction.c b/ctdb/lib/tdb/common/transaction.c
index ee6541fb1a..89319cdfd4 100644
--- a/ctdb/lib/tdb/common/transaction.c
+++ b/ctdb/lib/tdb/common/transaction.c
@@ -144,14 +144,6 @@ static int transaction_read(struct tdb_context *tdb, tdb_off_t off, void *buf,
{
uint32_t blk;
- /* Only a commit is allowed on a prepared transaction */
- if (tdb->transaction->prepared) {
- tdb->ecode = TDB_ERR_EINVAL;
- TDB_LOG((tdb, TDB_DEBUG_FATAL, "transaction_read: transaction already prepared, read not allowed\n"));
- tdb->transaction->transaction_error = 1;
- return -1;
- }
-
/* break it down into block sized ops */
while (len + (off % tdb->transaction->block_size) > tdb->transaction->block_size) {
tdb_len_t len2 = tdb->transaction->block_size - (off % tdb->transaction->block_size);