s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruption
commit6e5bfb7816e6d83920c9c6a12ecae18bdcbd448f
authorMichael Adam <obnox@samba.org>
Thu, 24 Mar 2011 23:29:42 +0000 (25 00:29 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 28 Mar 2011 22:19:19 +0000 (29 00:19 +0200)
tree3c24227fb31922ec59668724584803e3b2d4b7ff
parent26b26d975bebe81c47e243b4b0e186ccd5174deb
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