From ffe08ffcc2ea50dea4dca7b7b92a30021d3d3c96 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 3 Jun 2020 12:23:47 -0700 Subject: [PATCH] correct level information in version_set.cc (#6920) Summary: fix these two issues https://github.com/facebook/rocksdb/issues/6912 and https://github.com/facebook/rocksdb/issues/6667 Pull Request resolved: https://github.com/facebook/rocksdb/pull/6920 Reviewed By: cheng-chang Differential Revision: D21864885 Pulled By: ajkr fbshipit-source-id: 10e21fc1851b67a59d44358f59c64fa5523bd263 --- db/version_set.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/db/version_set.cc b/db/version_set.cc index 246e07f04..7fb4f5665 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -1806,11 +1806,11 @@ void Version::Get(const ReadOptions& read_options, const LookupKey& k, cfd_->internal_stats()->GetFileReadHist(fp.GetHitFileLevel()), IsFilterSkipped(static_cast(fp.GetHitFileLevel()), fp.IsHitFileLastInLevel()), - fp.GetCurrentLevel()); + fp.GetHitFileLevel()); // TODO: examine the behavior for corrupted key if (timer_enabled) { PERF_COUNTER_BY_LEVEL_ADD(get_from_table_nanos, timer.ElapsedNanos(), - fp.GetCurrentLevel()); + fp.GetHitFileLevel()); } if (!status->ok()) { return; @@ -1946,11 +1946,11 @@ void Version::MultiGet(const ReadOptions& read_options, MultiGetRange* range, cfd_->internal_stats()->GetFileReadHist(fp.GetHitFileLevel()), IsFilterSkipped(static_cast(fp.GetHitFileLevel()), fp.IsHitFileLastInLevel()), - fp.GetCurrentLevel()); + fp.GetHitFileLevel()); // TODO: examine the behavior for corrupted key if (timer_enabled) { PERF_COUNTER_BY_LEVEL_ADD(get_from_table_nanos, timer.ElapsedNanos(), - fp.GetCurrentLevel()); + fp.GetHitFileLevel()); } if (!s.ok()) { // TODO: Set status for individual keys appropriately @@ -5672,7 +5672,7 @@ InternalIterator* VersionSet::MakeInputIterator( /*table_reader_ptr=*/nullptr, /*file_read_hist=*/nullptr, TableReaderCaller::kCompaction, /*arena=*/nullptr, - /*skip_filters=*/false, /*level=*/static_cast(which), + /*skip_filters=*/false, /*level=*/static_cast(c->level(which)), /*smallest_compaction_key=*/nullptr, /*largest_compaction_key=*/nullptr, /*allow_unprepared_value=*/false); @@ -5686,7 +5686,7 @@ InternalIterator* VersionSet::MakeInputIterator( /*should_sample=*/false, /*no per level latency histogram=*/nullptr, TableReaderCaller::kCompaction, /*skip_filters=*/false, - /*level=*/static_cast(which), range_del_agg, + /*level=*/static_cast(c->level(which)), range_del_agg, c->boundaries(which)); } }