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)
committerMichael Adam <obnox@samba.org>
Fri, 12 Feb 2010 22:12:10 +0000 (23:12 +0100)
commit3fe7ce141d6afe3825b06c5feb90558911e4df1e
treeacf00fa72a228a61596e638275cfd7251c82b9b5
parent26225d3e798892b39b3c238b0bee465bffac6550
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
source3/lib/dbwrap_ctdb.c