* \brief this routine aborts the current remote transaction, if any, if the tid is wrong
*/
int
-urecovery_CheckTid(struct ubik_tid *atid)
+urecovery_CheckTid(struct ubik_tid *atid, int abortalways)
{
if (ubik_currentTrans) {
/* there is remote write trans, see if we match, see if this
* is a new transaction */
if (atid->epoch != ubik_currentTrans->tid.epoch
- || atid->counter > ubik_currentTrans->tid.counter) {
+ || atid->counter > ubik_currentTrans->tid.counter || abortalways) {
/* don't match, abort it */
/* If the thread is not waiting for lock - ok to end it */
#if !defined(UBIK_PAUSE)
return code;
}
DBHOLD(ubik_dbase);
- urecovery_CheckTid(atid);
- if (ubik_currentTrans) {
- /* If the thread is not waiting for lock - ok to end it */
-#if !defined(UBIK_PAUSE)
- if (ubik_currentTrans->locktype != LOCKWAIT) {
-#endif /* UBIK_PAUSE */
- udisk_end(ubik_currentTrans);
-#if !defined(UBIK_PAUSE)
- }
-#endif /* UBIK_PAUSE */
- ubik_currentTrans = (struct ubik_trans *)0;
- }
+ urecovery_CheckTid(atid, 1);
code = udisk_begin(ubik_dbase, UBIK_WRITETRANS, &ubik_currentTrans);
if (!code && ubik_currentTrans) {
/* label this trans with the right trans id */
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
ReleaseWriteLock(&dbase->cache_lock);
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;
}
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;
dbase = ubik_currentTrans->dbase;
DBHOLD(dbase);
- urecovery_CheckTid(atid);
+ urecovery_CheckTid(atid, 0);
if (!ubik_currentTrans) {
DBRELE(dbase);
return USYNC;