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.8.0_pre1^2~4518 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a0cc81c0894193db11860d8fe40380c7198741a9;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. Change-Id: I66f290d21fefdfcf9bd9deb704eefff987fe6970 Reviewed-on: http://gerrit.openafs.org/2647 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index aa9d62f41..4fadb95ce 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -786,11 +786,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);