Skip to content

Commit

Permalink
Fix asan erros
Browse files Browse the repository at this point in the history
  • Loading branch information
hx235 committed Apr 20, 2023
1 parent 8854661 commit 67a57b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
10 changes: 5 additions & 5 deletions db/compaction/compaction_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ Status CompactionJob::Run() {
ThreadStatus::STAGE_COMPACTION_RUN);
ThreadIOActivityGuardForTest thread_io_activity_guard(
Env::IOActivity::kCompaction);
const ReadOptions read_options(Env::IOActivity::kCompaction);

TEST_SYNC_POINT("CompactionJob::Run():Start");
log_buffer_->FlushBufferToLog();
LogCompaction();
Expand Down Expand Up @@ -729,10 +727,12 @@ Status CompactionJob::Run() {
// use_direct_io_for_flush_and_compaction is true, we will regard this
// verification as user reads since the goal is to cache it here for
// further user reads
const ReadOptions verify_table_read_options(
Env::IOActivity::kCompaction);
InternalIterator* iter = cfd->table_cache()->NewIterator(
read_options, file_options_, cfd->internal_comparator(),
files_output[file_idx]->meta, /*range_del_agg=*/nullptr,
prefix_extractor,
verify_table_read_options, file_options_,
cfd->internal_comparator(), files_output[file_idx]->meta,
/*range_del_agg=*/nullptr, prefix_extractor,
/*table_reader_ptr=*/nullptr,
cfd->internal_stats()->GetFileReadHist(
compact_->compaction->output_level()),
Expand Down
8 changes: 1 addition & 7 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7022,10 +7022,6 @@ Status ReactiveVersionSet::Recover(
assert(manifest_reporter != nullptr);
assert(manifest_reader_status != nullptr);

ThreadIOActivityGuardForTest thread_io_activity_guard(
Env::IOActivity::kDBOpen);
const ReadOptions read_options(Env::IOActivity::kDBOpen);

manifest_reader_status->reset(new Status());
manifest_reporter->reset(new LogReporter());
static_cast_with_check<LogReporter>(manifest_reporter->get())->status =
Expand All @@ -7039,7 +7035,7 @@ Status ReactiveVersionSet::Recover(

manifest_tailer_.reset(new ManifestTailer(
column_families, const_cast<ReactiveVersionSet*>(this), io_tracer_,
read_options, EpochNumberRequirement::kMightMissing));
read_options_, EpochNumberRequirement::kMightMissing));

manifest_tailer_->Iterate(*reader, manifest_reader_status->get());

Expand All @@ -7058,8 +7054,6 @@ Status ReactiveVersionSet::ReadAndApply(
assert(manifest_reader != nullptr);
assert(cfds_changed != nullptr);
mu->AssertHeld();
// TODO: plumb Env::IOActivity
const ReadOptions read_options;

Status s;
log::Reader* reader = manifest_reader->get();
Expand Down
3 changes: 2 additions & 1 deletion db/version_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,8 @@ class ReactiveVersionSet : public VersionSet {

private:
std::unique_ptr<ManifestTailer> manifest_tailer_;

// TODO: plumb Env::IOActivity
const ReadOptions read_options_;
using VersionSet::LogAndApply;
using VersionSet::Recover;

Expand Down

0 comments on commit 67a57b3

Please sign in to comment.