s3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions
authorMichael Adam <obnox@samba.org>
Fri, 11 Dec 2009 13:07:28 +0000 (14:07 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 31 Mar 2010 15:54:29 +0000 (17:54 +0200)
commitcfdf2d76878ee1ba32b2cb89f9ed740386990530
tree55b53cf5d94460232485b01c085fc598ac5332b6
parent06943fe1e6982c9df4886ee0a17572e502726897
s3:dbwrap_ctdb: maintain a database sequence number that bumps in transactions

For persistent databases, 64bit integer is kept in a special record
__db_sequence_number__. This record is incremented with each completed
transaction.

The retry mechanism for failing TRANS3_COMMIT controls inside the
db_ctdb_transaction_commit() function now relies one a modified
behaviour of ctdbd's treatment of persistent databases in recoveries.
Recently, a special treatment for persistent databases had been
introduced in ctdb (1.0.108) to work around the problems with the
orinal design of persistent transactions.
Now with the rewrite we need to revert to the old behaviour that
ctdb always takes the newest copies of all records.

This change also paves the way for a next step, which will make
recovery use the db seqnum to tell which node has the newest copy
of a persistent db and use that node's copy. This will greatly
reduce the amount of data transferred with each recovery.

Michael
(cherry picked from commit 3fe7ce141d6afe3825b06c5feb90558911e4df1e)
source3/lib/dbwrap_ctdb.c