|
|
|
@ -86,10 +86,14 @@ Status DBImpl::FlushMemTableToOutputFile( |
|
|
|
|
std::vector<SequenceNumber> snapshot_seqs = |
|
|
|
|
snapshots_.GetAll(&earliest_write_conflict_snapshot); |
|
|
|
|
|
|
|
|
|
auto snapshot_checker = snapshot_checker_.get(); |
|
|
|
|
if (use_custom_gc_ && snapshot_checker == nullptr) { |
|
|
|
|
snapshot_checker = DisableGCSnapshotChecker::Instance(); |
|
|
|
|
} |
|
|
|
|
FlushJob flush_job( |
|
|
|
|
dbname_, cfd, immutable_db_options_, mutable_cf_options, |
|
|
|
|
env_options_for_compaction_, versions_.get(), &mutex_, &shutting_down_, |
|
|
|
|
snapshot_seqs, earliest_write_conflict_snapshot, snapshot_checker_.get(), |
|
|
|
|
snapshot_seqs, earliest_write_conflict_snapshot, snapshot_checker, |
|
|
|
|
job_context, log_buffer, directories_.GetDbDir(), |
|
|
|
|
directories_.GetDataDir(0U), |
|
|
|
|
GetCompressionFlush(*cfd->ioptions(), mutable_cf_options), stats_, |
|
|
|
@ -531,13 +535,17 @@ Status DBImpl::CompactFilesImpl( |
|
|
|
|
auto pending_outputs_inserted_elem = |
|
|
|
|
CaptureCurrentFileNumberInPendingOutputs(); |
|
|
|
|
|
|
|
|
|
auto snapshot_checker = snapshot_checker_.get(); |
|
|
|
|
if (use_custom_gc_ && snapshot_checker == nullptr) { |
|
|
|
|
snapshot_checker = DisableGCSnapshotChecker::Instance(); |
|
|
|
|
} |
|
|
|
|
assert(is_snapshot_supported_ || snapshots_.empty()); |
|
|
|
|
CompactionJob compaction_job( |
|
|
|
|
job_context->job_id, c.get(), immutable_db_options_, |
|
|
|
|
env_options_for_compaction_, versions_.get(), &shutting_down_, log_buffer, |
|
|
|
|
directories_.GetDbDir(), directories_.GetDataDir(c->output_path_id()), |
|
|
|
|
stats_, &mutex_, &bg_error_, snapshot_seqs, |
|
|
|
|
earliest_write_conflict_snapshot, snapshot_checker_.get(), table_cache_, |
|
|
|
|
earliest_write_conflict_snapshot, snapshot_checker, table_cache_, |
|
|
|
|
&event_logger_, c->mutable_cf_options()->paranoid_file_checks, |
|
|
|
|
c->mutable_cf_options()->report_bg_io_stats, dbname_, |
|
|
|
|
nullptr); // Here we pass a nullptr for CompactionJobStats because
|
|
|
|
@ -1678,6 +1686,10 @@ Status DBImpl::BackgroundCompaction(bool* made_progress, |
|
|
|
|
std::vector<SequenceNumber> snapshot_seqs = |
|
|
|
|
snapshots_.GetAll(&earliest_write_conflict_snapshot); |
|
|
|
|
|
|
|
|
|
auto snapshot_checker = snapshot_checker_.get(); |
|
|
|
|
if (use_custom_gc_ && snapshot_checker == nullptr) { |
|
|
|
|
snapshot_checker = DisableGCSnapshotChecker::Instance(); |
|
|
|
|
} |
|
|
|
|
assert(is_snapshot_supported_ || snapshots_.empty()); |
|
|
|
|
CompactionJob compaction_job( |
|
|
|
|
job_context->job_id, c.get(), immutable_db_options_, |
|
|
|
@ -1685,7 +1697,7 @@ Status DBImpl::BackgroundCompaction(bool* made_progress, |
|
|
|
|
log_buffer, directories_.GetDbDir(), |
|
|
|
|
directories_.GetDataDir(c->output_path_id()), stats_, &mutex_, |
|
|
|
|
&bg_error_, snapshot_seqs, earliest_write_conflict_snapshot, |
|
|
|
|
snapshot_checker_.get(), table_cache_, &event_logger_, |
|
|
|
|
snapshot_checker, table_cache_, &event_logger_, |
|
|
|
|
c->mutable_cf_options()->paranoid_file_checks, |
|
|
|
|
c->mutable_cf_options()->report_bg_io_stats, dbname_, |
|
|
|
|
&compaction_job_stats); |
|
|
|
|