ITS#7970 LMDB: Critical Heisenbug

Inconsistent reading & SIGSEGV due to the race condition.
This commit is contained in:
leo@yuriev.ru 2014-10-17 22:35:41 +00:00 committed by Hallvard Furuseth
parent 1e5d79831c
commit 8230b1b630

View File

@ -2539,7 +2539,10 @@ mdb_txn_renew0(MDB_txn *txn)
return rc; return rc;
} }
} }
txn->mt_txnid = r->mr_txnid = ti->mti_txnid; do /* LY: Retry on a race, ITS#7970. */
r->mr_txnid = ti->mti_txnid;
while(r->mr_txnid != ti->mti_txnid);
txn->mt_txnid = r->mr_txnid;
txn->mt_u.reader = r; txn->mt_u.reader = r;
meta = env->me_metas[txn->mt_txnid & 1]; meta = env->me_metas[txn->mt_txnid & 1];
} }