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