@ -429,8 +429,7 @@ CompactionJob::CompactionJob(
bool paranoid_file_checks , bool measure_io_stats , const std : : string & dbname ,
bool paranoid_file_checks , bool measure_io_stats , const std : : string & dbname ,
CompactionJobStats * compaction_job_stats , Env : : Priority thread_pri ,
CompactionJobStats * compaction_job_stats , Env : : Priority thread_pri ,
const std : : shared_ptr < IOTracer > & io_tracer ,
const std : : shared_ptr < IOTracer > & io_tracer ,
const std : : atomic < int > * manual_compaction_paused ,
const std : : atomic < bool > & manual_compaction_canceled ,
const std : : atomic < bool > * manual_compaction_canceled ,
const std : : string & db_id , const std : : string & db_session_id ,
const std : : string & db_id , const std : : string & db_session_id ,
std : : string full_history_ts_low , std : : string trim_ts ,
std : : string full_history_ts_low , std : : string trim_ts ,
BlobFileCompletionCallback * blob_callback )
BlobFileCompletionCallback * blob_callback )
@ -456,7 +455,6 @@ CompactionJob::CompactionJob(
fs_ - > OptimizeForCompactionTableRead ( file_options , db_options_ ) ) ,
fs_ - > OptimizeForCompactionTableRead ( file_options , db_options_ ) ) ,
versions_ ( versions ) ,
versions_ ( versions ) ,
shutting_down_ ( shutting_down ) ,
shutting_down_ ( shutting_down ) ,
manual_compaction_paused_ ( manual_compaction_paused ) ,
manual_compaction_canceled_ ( manual_compaction_canceled ) ,
manual_compaction_canceled_ ( manual_compaction_canceled ) ,
db_directory_ ( db_directory ) ,
db_directory_ ( db_directory ) ,
blob_output_directory_ ( blob_output_directory ) ,
blob_output_directory_ ( blob_output_directory ) ,
@ -1256,8 +1254,8 @@ void CompactionJob::NotifyOnSubcompactionBegin(
if ( shutting_down_ - > load ( std : : memory_order_acquire ) ) {
if ( shutting_down_ - > load ( std : : memory_order_acquire ) ) {
return ;
return ;
}
}
if ( c - > is_manual_compaction ( ) & & manual_compaction_paused_ & &
if ( c - > is_manual_compaction ( ) & &
manual_compaction_paused_ - > load ( std : : memory_order_acquire ) > 0 ) {
manual_compaction_canceled_ . load ( std : : memory_order_acquire ) ) {
return ;
return ;
}
}
@ -1470,7 +1468,7 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
TEST_SYNC_POINT_CALLBACK (
TEST_SYNC_POINT_CALLBACK (
" CompactionJob::Run():PausingManualCompaction:1 " ,
" CompactionJob::Run():PausingManualCompaction:1 " ,
reinterpret_cast < void * > (
reinterpret_cast < void * > (
const_cast < std : : atomic < int > * > ( manual_compaction_paus ed_) ) ) ;
const_cast < std : : atomic < bool > * > ( & manual_compaction_cancel ed_) ) ) ;
Status status ;
Status status ;
const std : : string * const full_history_ts_low =
const std : : string * const full_history_ts_low =
@ -1484,9 +1482,9 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
snapshot_checker_ , env_ , ShouldReportDetailedTime ( env_ , stats_ ) ,
snapshot_checker_ , env_ , ShouldReportDetailedTime ( env_ , stats_ ) ,
/*expect_valid_internal_key=*/ true , & range_del_agg ,
/*expect_valid_internal_key=*/ true , & range_del_agg ,
blob_file_builder . get ( ) , db_options_ . allow_data_in_errors ,
blob_file_builder . get ( ) , db_options_ . allow_data_in_errors ,
db_options_ . enforce_single_del_contracts , sub_compact - > compaction ,
db_options_ . enforce_single_del_contracts , manual_compaction_canceled_ ,
compaction_filter , shutting_down_ , manual_compaction_paused _ ,
sub_compact - > compaction , compaction_filter , shutting_down_ ,
manual_compaction_canceled_ , db_options_ . info_log , full_history_ts_low ) ) ;
db_options_ . info_log , full_history_ts_low ) ) ;
auto c_iter = sub_compact - > c_iter . get ( ) ;
auto c_iter = sub_compact - > c_iter . get ( ) ;
c_iter - > SeekToFirst ( ) ;
c_iter - > SeekToFirst ( ) ;
if ( c_iter - > Valid ( ) & & sub_compact - > compaction - > output_level ( ) ! = 0 ) {
if ( c_iter - > Valid ( ) & & sub_compact - > compaction - > output_level ( ) ! = 0 ) {
@ -1568,7 +1566,7 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
TEST_SYNC_POINT_CALLBACK (
TEST_SYNC_POINT_CALLBACK (
" CompactionJob::Run():PausingManualCompaction:2 " ,
" CompactionJob::Run():PausingManualCompaction:2 " ,
reinterpret_cast < void * > (
reinterpret_cast < void * > (
const_cast < std : : atomic < int > * > ( manual_compaction_paus ed_) ) ) ;
const_cast < std : : atomic < bool > * > ( & manual_compaction_cancel ed_) ) ) ;
if ( partitioner . get ( ) ) {
if ( partitioner . get ( ) ) {
last_key_for_partitioner . assign ( c_iter - > user_key ( ) . data_ ,
last_key_for_partitioner . assign ( c_iter - > user_key ( ) . data_ ,
c_iter - > user_key ( ) . size_ ) ;
c_iter - > user_key ( ) . size_ ) ;
@ -1647,10 +1645,7 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
status = Status : : ShutdownInProgress ( " Database shutdown " ) ;
status = Status : : ShutdownInProgress ( " Database shutdown " ) ;
}
}
if ( ( status . ok ( ) | | status . IsColumnFamilyDropped ( ) ) & &
if ( ( status . ok ( ) | | status . IsColumnFamilyDropped ( ) ) & &
( ( manual_compaction_paused_ & &
( manual_compaction_canceled_ . load ( std : : memory_order_relaxed ) ) ) {
manual_compaction_paused_ - > load ( std : : memory_order_relaxed ) > 0 ) | |
( manual_compaction_canceled_ & &
manual_compaction_canceled_ - > load ( std : : memory_order_relaxed ) ) ) ) {
status = Status : : Incomplete ( Status : : SubCode : : kManualCompactionPaused ) ;
status = Status : : Incomplete ( Status : : SubCode : : kManualCompactionPaused ) ;
}
}
if ( status . ok ( ) ) {
if ( status . ok ( ) ) {
@ -2527,7 +2522,7 @@ CompactionServiceCompactionJob::CompactionServiceCompactionJob(
std : : vector < SequenceNumber > existing_snapshots ,
std : : vector < SequenceNumber > existing_snapshots ,
std : : shared_ptr < Cache > table_cache , EventLogger * event_logger ,
std : : shared_ptr < Cache > table_cache , EventLogger * event_logger ,
const std : : string & dbname , const std : : shared_ptr < IOTracer > & io_tracer ,
const std : : string & dbname , const std : : shared_ptr < IOTracer > & io_tracer ,
const std : : atomic < bool > * manual_compaction_canceled ,
const std : : atomic < bool > & manual_compaction_canceled ,
const std : : string & db_id , const std : : string & db_session_id ,
const std : : string & db_id , const std : : string & db_session_id ,
const std : : string & output_path ,
const std : : string & output_path ,
const CompactionServiceInput & compaction_service_input ,
const CompactionServiceInput & compaction_service_input ,
@ -2540,7 +2535,7 @@ CompactionServiceCompactionJob::CompactionServiceCompactionJob(
compaction - > mutable_cf_options ( ) - > paranoid_file_checks ,
compaction - > mutable_cf_options ( ) - > paranoid_file_checks ,
compaction - > mutable_cf_options ( ) - > report_bg_io_stats , dbname ,
compaction - > mutable_cf_options ( ) - > report_bg_io_stats , dbname ,
& ( compaction_service_result - > stats ) , Env : : Priority : : USER , io_tracer ,
& ( compaction_service_result - > stats ) , Env : : Priority : : USER , io_tracer ,
nullptr , manual_compaction_canceled , db_id , db_session_id ,
manual_compaction_canceled , db_id , db_session_id ,
compaction - > column_family_data ( ) - > GetFullHistoryTsLow ( ) ) ,
compaction - > column_family_data ( ) - > GetFullHistoryTsLow ( ) ) ,
output_path_ ( output_path ) ,
output_path_ ( output_path ) ,
compaction_input_ ( compaction_service_input ) ,
compaction_input_ ( compaction_service_input ) ,