@ -508,24 +508,22 @@ void WritePreparedTxnDB::AddCommitted(uint64_t prepare_seq, uint64_t commit_seq,
prev_max , max_evicted_seq ) ;
prev_max , max_evicted_seq ) ;
AdvanceMaxEvictedSeq ( prev_max , max_evicted_seq ) ;
AdvanceMaxEvictedSeq ( prev_max , max_evicted_seq ) ;
}
}
// After each eviction from commit cache, check if the commit entry should
// be kept around because it overlaps with a live snapshot.
CheckAgainstSnapshots ( evicted ) ;
if ( UNLIKELY ( ! delayed_prepared_empty_ . load ( std : : memory_order_acquire ) ) ) {
if ( UNLIKELY ( ! delayed_prepared_empty_ . load ( std : : memory_order_acquire ) ) ) {
WriteLock wl ( & prepared_mutex_ ) ;
WriteLock wl ( & prepared_mutex_ ) ;
for ( auto dp : delayed_prepared_ ) {
auto dp_iter = delayed_prepared_ . find ( evicted . prep_seq ) ;
if ( dp = = evicted . prep_seq ) {
if ( dp_iter ! = delayed_prepared_ . end ( ) ) {
// This is a rare case that txn is committed but prepared_txns_ is not
// This is a rare case that txn is committed but prepared_txns_ is not
// cleaned up yet. Refer to delayed_prepared_commits_ definition for
// cleaned up yet. Refer to delayed_prepared_commits_ definition for
// why it should be kept updated.
// why it should be kept updated.
delayed_prepared_commits_ [ evicted . prep_seq ] = evicted . commit_seq ;
delayed_prepared_commits_ [ evicted . prep_seq ] = evicted . commit_seq ;
ROCKS_LOG_DEBUG ( info_log_ ,
ROCKS_LOG_DEBUG ( info_log_ ,
" delayed_prepared_commits_[% " PRIu64 " ]=% " PRIu64 ,
" delayed_prepared_commits_[% " PRIu64 " ]=% " PRIu64 ,
evicted . prep_seq , evicted . commit_seq ) ;
evicted . prep_seq , evicted . commit_seq ) ;
break ;
}
}
}
}
}
// After each eviction from commit cache, check if the commit entry should
// be kept around because it overlaps with a live snapshot.
CheckAgainstSnapshots ( evicted ) ;
}
}
bool succ =
bool succ =
ExchangeCommitEntry ( indexed_seq , evicted_64b , { prepare_seq , commit_seq } ) ;
ExchangeCommitEntry ( indexed_seq , evicted_64b , { prepare_seq , commit_seq } ) ;