]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
ubik: Record the last write tid in writeTidCounter
authorAndrew Deason <adeason@sinenomine.net>
Wed, 1 Sep 2010 20:10:56 +0000 (15:10 -0500)
committerDerrick Brashear <shadow@dementix.org>
Wed, 2 Nov 2011 02:28:05 +0000 (19:28 -0700)
ubik is currently tracking writeTidCounter for write transactions
separately from regular transactions (assigned from tidCounter).
Specifically, tidCounter is incremented twice for each transaction,
but writeTidCounter is incremented twice only for write transactions.
As a result, writeTidCounter and tidCounter tend to drift far apart.

This is a problem, since the tid for DISK_* calls uses the transaction
id of the current transaction (based on tidCounter), and VOTE_Beacon
uses writeTidCounter for its transaction id. So, in effect, the tid in
VOTE_Beacon is completely bogus and unrelated to the transaction id of
the actual current write transaction. This can cause valid write
transactions to become invalidated when tidCounter becomes negative,
since VOTE_Beacon will send a positive tid, and if there is a current
in-flight write transaction with a negative tid, SVOTE_Beacon will
deem the transactions inequal and will abort the write transaction.

So instead, record the transaction id counter for the last write
transaction in writeTidCounter. This way, when we call VOTE_Beacon, we
will use the correct transaction id counter for the current write
transaction, and SVOTE_Beacon on the remote site will not invalidate
the transaction.

Reviewed-on: http://gerrit.openafs.org/2647
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a0cc81c0894193db11860d8fe40380c7198741a9)

Change-Id: Iabff9bd68db088c30c7e44ad71b7d34bcfaaf207
Reviewed-on: http://gerrit.openafs.org/5751
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
src/ubik/ubik.c

index cfa3d85f6be317627f9e094496d1a1521da6e828..fc363ca90bd2462d482a772bb7bf8295b9dd60d8 100644 (file)
@@ -699,11 +699,7 @@ BeginTrans(struct ubik_dbase *dbase, afs_int32 transMode,
 
     if (transMode == UBIK_WRITETRANS) {
        /* for a write trans, we have to keep track of the write tid counter too */
-#if defined(UBIK_PAUSE)
        dbase->writeTidCounter = tt->tid.counter;
-#else
-       dbase->writeTidCounter += 2;
-#endif /* UBIK_PAUSE */
 
        /* next try to start transaction on appropriate number of machines */
        code = ContactQuorum_NoArguments(DISK_Begin, tt, 0);