ITS#8226 optimization

Don't release read txn unless there has actually been a new write txn
This commit is contained in:
Howard Chu 2017-08-01 22:08:50 +01:00
parent 9827569ff0
commit 221dd43399

View File

@ -1125,8 +1125,11 @@ loop_continue:
if ( moi == &opinfo && !wwctx.flag && mdb->mi_rtxn_size ) { if ( moi == &opinfo && !wwctx.flag && mdb->mi_rtxn_size ) {
wwctx.nentries++; wwctx.nentries++;
if ( wwctx.nentries >= mdb->mi_rtxn_size ) { if ( wwctx.nentries >= mdb->mi_rtxn_size ) {
MDB_envinfo ei;
wwctx.nentries = 0; wwctx.nentries = 0;
mdb_rtxn_snap( op, &wwctx ); mdb_env_info(mdb->mi_dbenv, &ei);
if ( ei.me_last_txnid > mdb_txn_id( ltid ))
mdb_rtxn_snap( op, &wwctx );
} }
} }
if ( wwctx.flag ) { if ( wwctx.flag ) {