Skip to content

Commit f09e5cc

Browse files
authored
[fix](cloud) Not print too much peer read err log (#59354)
### What problem does this PR solve? Not print stack when peer read meet err ``` W20251225 11:05:21.592509 399889 status.h:445] meet error status: [INTERNAL_ERROR]PStatus: read cache file error 0# doris::Status doris::Status::create<true>(doris::PStatus const&) at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:187 1# doris::io::PeerFileCacheReader::fetch_blocks(std::vector<std::shared_ptr<doris::io::FileBlock>, std::allocator<std::shared_ptr<doris::io::FileBlock> > > const&, unsigned long, doris::Slice, unsigned long*, unsigned long, doris::io::IOContext const*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/io/cache/peer_file_cache _reader.cpp:0 2# doris::io::(anonymous namespace)::execute_peer_read(std::vector<std::shared_ptr<doris::io::FileBlock>, std::allocator<std::shared_ptr<doris::io::FileBlock> > > const&, unsigned long, unsigned long&, std::unique_ptr<char [], std::default_delete<char []> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, bool, doris::io::ReadStatistics&, doris::io::IOContext const*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 3# doris::io::CachedRemoteFileReader::_execute_remote_read(std::vector<std::shared_ptr<doris::io::FileBlock>, std::allocator<std::shared_ptr<doris::io::FileBlock> > > const&, unsigned long, unsigned long&, std::unique_ptr<char [], std::default_delete<char []> >&, doris::io::ReadStatistics&, doris::io::IOContext const*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/io/cache/cached_remote_file_reader.cpp:270 4# doris::io::CachedRemoteFileReader::read_at_impl(unsigned long, doris::Slice, unsigned long*, doris::io::IOContext const*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 5# doris::io::FileReader::read_at(unsigned long, doris::Slice, unsigned long*, doris::io::IOContext const*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 6# doris::segment_v2::PageIO::read_and_decompress_page_(doris::segment_v2::PageReadOptions const&, doris::segment_v2::PageHandle*, doris::Slice*, doris::segment_v2::PageFooterPB*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 7# doris::segment_v2::PageIO::do_read_and_decompress_page(doris::segment_v2::PageReadOptions const&, doris::segment_v2::PageHandle*, doris::Slice*, doris::segment_v2::PageFooterPB*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/olap/rowset/segment_v2/page_io.h:157 8# doris::segment_v2::PageIO::read_and_decompress_page(doris::segment_v2::PageReadOptions const&, doris::segment_v2::PageHandle*, doris::Slice*, doris::segment_v2::PageFooterPB*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:501 9# doris::segment_v2::FileColumnIterator::_read_data_page(doris::segment_v2::OrdinalPageIndexIterator const&) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/olap/rowset/segment_v2/column_reader.cpp:0 10# doris::segment_v2::FileColumnIterator::_load_next_page(bool*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 11# doris::segment_v2::FileColumnIterator::next_batch(unsigned long*, COW<doris::vectorized::IColumn>::mutable_ptr<doris::vectorized::IColumn>&, bool*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 12# doris::segment_v2::SegmentIterator::_read_columns_by_index(unsigned int, unsigned int&, bool) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 13# doris::segment_v2::SegmentIterator::_next_batch_internal(doris::vectorized::Block*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 14# doris::segment_v2::SegmentIterator::next_batch(doris::vectorized::Block*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 15# doris::vectorized::VerticalMergeIteratorContext::_load_next_block() at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 16# doris::vectorized::VerticalHeapMergeIterator::next_batch(doris::vectorized::Block*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 17# doris::vectorized::VerticalBlockReader::_direct_next_block(doris::vectorized::Block*, bool*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 18# doris::vectorized::VerticalBlockReader::next_block_with_aggregation(doris::vectorized::Block*, bool*) at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:907 19# doris::Merger::vertical_compact_one_group(std::shared_ptr<doris::BaseTablet>, doris::ReaderType, doris::TabletSchema const&, bool, std::vector<unsigned int, std::allocator<unsigned int> > const&, doris::vectorized::RowSourcesBuffer*, std::vector<std::shared_ptr<doris::RowsetReader>, std::allocator<std::shared_ptr<doris::RowsetReader> > > const&, doris::RowsetWriter*, long, doris::Merger::Statistics*, std::vector<unsigned int, std::allocator<unsigned int> >, long, doris::CompactionSampleInfo*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/olap/merger.cpp:0 20# doris::Merger::vertical_merge_rowsets(std::shared_ptr<doris::BaseTablet>, doris::ReaderType, doris::TabletSchema const&, std::vector<std::shared_ptr<doris::RowsetReader>, std::allocator<std::shared_ptr<doris::RowsetReader> > > const&, doris::RowsetWriter*, long, long, doris::Merger::Statistics*) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/olap/merger.cpp:481 21# doris::Compaction::merge_input_rowsets() at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/olap/compaction.cpp:204 22# doris::CloudCompactionMixin::execute_compact_impl(long) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 23# doris::CloudCompactionMixin::execute_compact() at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:506 24# doris::CloudBaseCompaction::execute_compact() at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:392 25# std::_Function_handler<void (), doris::CloudStorageEngine::_submit_base_compaction_task(std::shared_ptr<doris::CloudTablet> const&)::$_0>::_M_invoke(std::_Any_data const&) at /mnt/disk3/pipeline/repo/selectdb-core_branch-hotfix-selectdb-doris-3.1-c/selectdb-core/be/src/common/status.h:392 26# doris::ThreadPool::dispatch_thread() at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:730 27# doris::Thread::supervise_thread(void*) at /var/local/ldb-toolchain/bin/../usr/include/pthread.h:562 28# ? 29# ? ```
1 parent 425c698 commit f09e5cc

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

be/src/io/cache/cached_remote_file_reader.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,13 @@ std::pair<std::string, int> get_peer_connection_info(const std::string& file_pat
170170
host = tablet_info->first;
171171
port = tablet_info->second;
172172
} else {
173-
LOG_WARNING("get peer connection info not found")
174-
.tag("tablet_id", *tablet_id)
175-
.tag("file_path", file_path);
173+
LOG_EVERY_N(WARNING, 100)
174+
<< "get peer connection info not found"
175+
<< ", tablet_id=" << *tablet_id << ", file_path=" << file_path;
176176
}
177177
} else {
178-
LOG_WARNING("parse tablet id from path failed")
179-
.tag("tablet_id", "null")
180-
.tag("file_path", file_path);
178+
LOG_EVERY_N(WARNING, 100) << "parse tablet id from path failed"
179+
<< "tablet_id=null, file_path=" << file_path;
181180
}
182181

183182
DBUG_EXECUTE_IF("PeerFileCacheReader::_fetch_from_peer_cache_blocks", {
@@ -215,10 +214,9 @@ Status execute_peer_read(const std::vector<FileBlockSPtr>& empty_blocks, size_t
215214
auto st = peer_reader.fetch_blocks(empty_blocks, empty_start, Slice(buffer.get(), size), &size,
216215
file_size, io_ctx);
217216
if (!st.ok()) {
218-
LOG_WARNING("PeerFileCacheReader read from peer failed")
219-
.tag("host", host)
220-
.tag("port", port)
221-
.tag("error", st.msg());
217+
LOG_EVERY_N(WARNING, 100) << "PeerFileCacheReader read from peer failed"
218+
<< ", host=" << host << ", port=" << port
219+
<< ", error=" << st.msg();
222220
}
223221
stats.from_peer_cache = true;
224222
return st;

be/src/io/cache/peer_file_cache_reader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ Status PeerFileCacheReader::fetch_blocks(const std::vector<FileBlockSPtr>& block
133133
return Status::RpcError<false>(cntl.ErrorText());
134134
}
135135
if (resp.has_status()) {
136-
Status st2 = Status::create(resp.status());
136+
Status st2 = Status::create<false>(resp.status());
137+
LOG_EVERY_N(WARNING, 1000) << "peer cache read failed, status=" << st2.msg();
137138
if (!st2.ok()) return st2;
138139
}
139140

0 commit comments

Comments
 (0)