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>
Thu, 1 Apr 2010 07:39:14 +0000 (09:39 +0200)
commit5e6666ff391b10ed9454fc8cba3c6795f3e2e036
treea4eb1871c56e2d3649cf12b0dc4f378718c6933c
parenta3726f340eb211dfbac3929ad36496de2ac836dc
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)
(cherry picked from commit cfdf2d76878ee1ba32b2cb89f9ed740386990530)
source3/lib/dbwrap_ctdb.c