|
|
@ -1048,22 +1048,22 @@ Status DBImpl::SwitchWAL(WriteContext* write_context) { |
|
|
|
auto oldest_alive_log = alive_log_files_.begin()->number; |
|
|
|
auto oldest_alive_log = alive_log_files_.begin()->number; |
|
|
|
bool flush_wont_release_oldest_log = false; |
|
|
|
bool flush_wont_release_oldest_log = false; |
|
|
|
if (allow_2pc()) { |
|
|
|
if (allow_2pc()) { |
|
|
|
auto oldest_log_with_uncommited_prep = |
|
|
|
auto oldest_log_with_uncommitted_prep = |
|
|
|
logs_with_prep_tracker_.FindMinLogContainingOutstandingPrep(); |
|
|
|
logs_with_prep_tracker_.FindMinLogContainingOutstandingPrep(); |
|
|
|
|
|
|
|
|
|
|
|
assert(oldest_log_with_uncommited_prep == 0 || |
|
|
|
assert(oldest_log_with_uncommitted_prep == 0 || |
|
|
|
oldest_log_with_uncommited_prep >= oldest_alive_log); |
|
|
|
oldest_log_with_uncommitted_prep >= oldest_alive_log); |
|
|
|
if (oldest_log_with_uncommited_prep > 0 && |
|
|
|
if (oldest_log_with_uncommitted_prep > 0 && |
|
|
|
oldest_log_with_uncommited_prep == oldest_alive_log) { |
|
|
|
oldest_log_with_uncommitted_prep == oldest_alive_log) { |
|
|
|
if (unable_to_release_oldest_log_) { |
|
|
|
if (unable_to_release_oldest_log_) { |
|
|
|
// we already attempted to flush all column families dependent on
|
|
|
|
// we already attempted to flush all column families dependent on
|
|
|
|
// the oldest alive log but the log still contained uncommited
|
|
|
|
// the oldest alive log but the log still contained uncommitted
|
|
|
|
// transactions so there is still nothing that we can do.
|
|
|
|
// transactions so there is still nothing that we can do.
|
|
|
|
return status; |
|
|
|
return status; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ROCKS_LOG_WARN( |
|
|
|
ROCKS_LOG_WARN( |
|
|
|
immutable_db_options_.info_log, |
|
|
|
immutable_db_options_.info_log, |
|
|
|
"Unable to release oldest log due to uncommited transaction"); |
|
|
|
"Unable to release oldest log due to uncommitted transaction"); |
|
|
|
unable_to_release_oldest_log_ = true; |
|
|
|
unable_to_release_oldest_log_ = true; |
|
|
|
flush_wont_release_oldest_log = true; |
|
|
|
flush_wont_release_oldest_log = true; |
|
|
|
} |
|
|
|
} |
|
|
|