Skip to content

Commit 30a5ed9

Browse files
Update "num_data_read" stat in RetrieveMultipleBlocks (facebook#7770)
Summary: RetrieveMultipleBlocks which is used by MultiGet to read data blocks is not updating num_data_read stat in GetContextStats. Pull Request resolved: facebook#7770 Test Plan: make check -j64 Reviewed By: anand1976 Differential Revision: D25538982 Pulled By: akankshamahajan15 fbshipit-source-id: e3daedb035b1be8ab6af6f115cb3793ccc7b1ec6
1 parent bdb7e54 commit 30a5ed9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

db/db_basic_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ TEST_F(DBBasicTest, MultiGetStats) {
19611961
ASSERT_GT(hist_sst.max, 0);
19621962

19631963
// Minimun number of blocks read in a level.
1964-
ASSERT_EQ(hist_data_blocks.min, 0);
1964+
ASSERT_EQ(hist_data_blocks.min, 3);
19651965
ASSERT_GT(hist_index_and_filter_blocks.min, 0);
19661966
// Minimun number of sst files read in a level.
19671967
ASSERT_GT(hist_sst.max, 0);

table/block_based/block_based_table_reader.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,9 @@ void BlockBasedTable::RetrieveMultipleBlocks(
17681768
size_t& req_idx = req_idx_for_block[valid_batch_idx];
17691769
size_t& req_offset = req_offset_for_block[valid_batch_idx];
17701770
valid_batch_idx++;
1771+
if (mget_iter->get_context) {
1772+
++(mget_iter->get_context->get_context_stats_.num_data_read);
1773+
}
17711774
FSReadRequest& req = read_reqs[req_idx];
17721775
Status s = req.status;
17731776
if (s.ok()) {

0 commit comments

Comments
 (0)