ITS#7970 LMDB: Critical Heisenbug

Inconsistent reading & SIGSEGV due to the race condition.
mdb.RE/0.9
leo@yuriev.ru 10 years ago committed by Hallvard Furuseth
parent 1e5d79831c
commit 8230b1b630
  1. 5
      libraries/liblmdb/mdb.c

@ -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];
} }

Loading…
Cancel
Save