|
|
|
@ -1779,16 +1779,12 @@ Status DBImpl::CompactFilesImpl( |
|
|
|
|
// deletion compaction currently not allowed in CompactFiles.
|
|
|
|
|
assert(!c->deletion_compaction()); |
|
|
|
|
|
|
|
|
|
SequenceNumber earliest_write_conflict_snapshot; |
|
|
|
|
std::vector<SequenceNumber> snapshot_seqs = |
|
|
|
|
snapshots_.GetAll(&earliest_write_conflict_snapshot); |
|
|
|
|
|
|
|
|
|
assert(is_snapshot_supported_ || snapshots_.empty()); |
|
|
|
|
CompactionJob compaction_job( |
|
|
|
|
job_context->job_id, c.get(), db_options_, env_options_, versions_.get(), |
|
|
|
|
&shutting_down_, log_buffer, directories_.GetDbDir(), |
|
|
|
|
directories_.GetDataDir(c->output_path_id()), stats_, snapshot_seqs, |
|
|
|
|
earliest_write_conflict_snapshot, table_cache_, &event_logger_, |
|
|
|
|
directories_.GetDataDir(c->output_path_id()), stats_, snapshots_.GetAll(), |
|
|
|
|
table_cache_, &event_logger_, |
|
|
|
|
c->mutable_cf_options()->paranoid_file_checks, |
|
|
|
|
c->mutable_cf_options()->compaction_measure_io_stats, dbname_, |
|
|
|
|
nullptr); // Here we pass a nullptr for CompactionJobStats because
|
|
|
|
@ -2872,17 +2868,12 @@ Status DBImpl::BackgroundCompaction(bool* made_progress, |
|
|
|
|
int output_level __attribute__((unused)) = c->output_level(); |
|
|
|
|
TEST_SYNC_POINT_CALLBACK("DBImpl::BackgroundCompaction:NonTrivial", |
|
|
|
|
&output_level); |
|
|
|
|
|
|
|
|
|
SequenceNumber earliest_write_conflict_snapshot; |
|
|
|
|
std::vector<SequenceNumber> snapshot_seqs = |
|
|
|
|
snapshots_.GetAll(&earliest_write_conflict_snapshot); |
|
|
|
|
|
|
|
|
|
assert(is_snapshot_supported_ || snapshots_.empty()); |
|
|
|
|
CompactionJob compaction_job( |
|
|
|
|
job_context->job_id, c.get(), db_options_, env_options_, |
|
|
|
|
versions_.get(), &shutting_down_, log_buffer, directories_.GetDbDir(), |
|
|
|
|
directories_.GetDataDir(c->output_path_id()), stats_, snapshot_seqs, |
|
|
|
|
earliest_write_conflict_snapshot, table_cache_, &event_logger_, |
|
|
|
|
directories_.GetDataDir(c->output_path_id()), stats_, |
|
|
|
|
snapshots_.GetAll(), table_cache_, &event_logger_, |
|
|
|
|
c->mutable_cf_options()->paranoid_file_checks, |
|
|
|
|
c->mutable_cf_options()->compaction_measure_io_stats, dbname_, |
|
|
|
|
&compaction_job_stats); |
|
|
|
@ -3793,13 +3784,7 @@ Status DBImpl::NewIterators( |
|
|
|
|
return Status::OK(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const Snapshot* DBImpl::GetSnapshot() { return GetSnapshotImpl(false); } |
|
|
|
|
|
|
|
|
|
const Snapshot* DBImpl::GetSnapshotForWriteConflictBoundary() { |
|
|
|
|
return GetSnapshotImpl(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const Snapshot* DBImpl::GetSnapshotImpl(bool is_write_conflict_boundary) { |
|
|
|
|
const Snapshot* DBImpl::GetSnapshot() { |
|
|
|
|
int64_t unix_time = 0; |
|
|
|
|
env_->GetCurrentTime(&unix_time); // Ignore error
|
|
|
|
|
SnapshotImpl* s = new SnapshotImpl; |
|
|
|
@ -3810,8 +3795,7 @@ const Snapshot* DBImpl::GetSnapshotImpl(bool is_write_conflict_boundary) { |
|
|
|
|
delete s; |
|
|
|
|
return nullptr; |
|
|
|
|
} |
|
|
|
|
return snapshots_.New(s, versions_->LastSequence(), unix_time, |
|
|
|
|
is_write_conflict_boundary); |
|
|
|
|
return snapshots_.New(s, versions_->LastSequence(), unix_time); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DBImpl::ReleaseSnapshot(const Snapshot* s) { |
|
|
|
|