s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruption
authorMichael Adam <obnox@samba.org>
Thu, 24 Mar 2011 23:29:42 +0000 (00:29 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 25 Mar 2011 00:26:32 +0000 (01:26 +0100)
commit8812148e2436b5ad9120181797e432285ccbb983
tree925c41bda6838ea999f83f7926a5031f7c23fdef
parent68529bc14efd077531086b3e8bcaf85287cfa6ba
s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruption

When doing a non-locking fetch on a record of a persistent db when no
transaction is running, the old behaviour was to fetch locally and
do a ctdb call when the record was not found in the local db.
The call is useless for persistent dbs anyway since they are only
written to using transactions and hence kept in sync, but it is
also harmful, because a ctdb call will bump the record RSN when it
does actually migrate the record from one node to another.

Recently, ctdb has been changed to make all calls do a migration.
This uncovered the client misbehaviour for persistent dbs, because
now _each_ non-locking fetch will render the persistent db inconsistent:
A subsequent transaction which touches the record in question will
fail because the RSNs are out of sync.

This patch fixes this old bug.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Mar 25 01:26:32 CET 2011 on sn-devel-104
source3/lib/dbwrap_ctdb.c