From: Andrew Deason Date: Wed, 1 Sep 2010 20:10:56 +0000 (-0500) Subject: ubik: Record the last write tid in writeTidCounter X-Git-Tag: upstream/1.6.1.pre1^2~151 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=4c80871a16d6022c3d3e5edc0504208ddad49cc8;p=packages%2Fo%2Fopenafs.git ubik: Record the last write tid in writeTidCounter 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 Reviewed-by: Derrick Brashear (cherry picked from commit a0cc81c0894193db11860d8fe40380c7198741a9) Change-Id: Iabff9bd68db088c30c7e44ad71b7d34bcfaaf207 Reviewed-on: http://gerrit.openafs.org/5751 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index cfa3d85f6..fc363ca90 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -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);