From 0b10e7dbbae4773e56ae6de5cb3d699faaa7ac1f Mon Sep 17 00:00:00 2001 From: Hui Xiao Date: Fri, 28 Jun 2024 12:01:13 -0700 Subject: [PATCH] Ignore more non-critical IO error in BlockCacheLookupForReadAheadSize() in crash test (#12822) Summary: **Context/Summary:** Similar to https://github.com/facebook/rocksdb/pull/12814#issue-2376803461 Pull Request resolved: https://github.com/facebook/rocksdb/pull/12822 Test Plan: CI Reviewed By: jaykorean Differential Revision: D59166188 Pulled By: hx235 fbshipit-source-id: 68c2eb7b319103ede0ba34944a0737440aecb17f --- table/block_based/block_based_table_iterator.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/table/block_based/block_based_table_iterator.cc b/table/block_based/block_based_table_iterator.cc index a05da32b44..14db24d9b3 100644 --- a/table/block_based/block_based_table_iterator.cc +++ b/table/block_based/block_based_table_iterator.cc @@ -823,6 +823,12 @@ void BlockBasedTableIterator::BlockCacheLookupForReadAheadSize( read_options_, block_handle, &(block_handle_info.cachable_entry_).As()); if (!s.ok()) { +#ifndef NDEBUG + // To allow fault injection verification to pass since non-okay status in + // `BlockCacheLookupForReadAheadSize()` won't fail the read but to have + // less or no readahead + IGNORE_STATUS_IF_ERROR(s); +#endif break; } @@ -853,6 +859,9 @@ void BlockBasedTableIterator::BlockCacheLookupForReadAheadSize( } #ifndef NDEBUG + // To allow fault injection verification to pass since non-okay status in + // `BlockCacheLookupForReadAheadSize()` won't fail the read but to have less + // or no readahead if (!index_iter_->status().ok()) { IGNORE_STATUS_IF_ERROR(index_iter_->status()); }