Commit a57c1a66 authored by Yoni Fogel's avatar Yoni Fogel

[t:5067] Reduce GC-system overhead for read-only transactions

git-svn-id: file:///svn/toku/tokudb@44750 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7029824b
......@@ -136,8 +136,8 @@ verify_snapshot_system(TXN_MANAGER txn_manager UU()) {
// Only committed entries have return a youngest.
invariant(youngest == TXNID_NONE);
}
else {
invariant(youngest != TXNID_NONE);
else if (youngest != TXNID_NONE) {
// A committed entry might have been read-only, in which case it won't return anything.
// This snapshot reads 'live_xid' so it's youngest cannot be older than snapshot_xid.
invariant(youngest >= snapshot_xid);
}
......@@ -586,8 +586,10 @@ void toku_txn_manager_finish_txn(TXN_MANAGER txn_manager, TOKUTXN txn) {
r = toku_omt_delete_at(txn_manager->live_root_txns, idx);
invariant_zero(r);
if (txn->begin_was_logged) {
if (!is_snapshot) {
// If it's a snapshot, we already calculated index_in_snapshot_txnids.
// Otherwise, calculate it now.
r = toku_omt_find_zero(txn_manager->snapshot_txnids, toku_find_xid_by_xid, (OMTVALUE) txn->txnid64, NULL, &index_in_snapshot_txnids);
invariant(r == DB_NOTFOUND);
}
......@@ -608,6 +610,7 @@ void toku_txn_manager_finish_txn(TXN_MANAGER txn_manager, TOKUTXN txn) {
lazy_assert_zero(r);
}
}
}
assert(txn_manager->oldest_living_xid <= txn->txnid64);
if (txn->txnid64 == txn_manager->oldest_living_xid) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment