-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[opt](segment) Ignore not-found segments in query and load paths #61844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
03410a6
c3371a0
152eff1
9d46c42
47f2191
779e021
0edbb33
9f587cb
93578cd
60bb3c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
|
|
||
| #include "storage/segment/lazy_init_segment_iterator.h" | ||
|
|
||
| #include "storage/rowset/beta_rowset.h" | ||
| #include "storage/segment/segment_loader.h" | ||
|
|
||
| namespace doris::segment_v2 { | ||
|
|
@@ -40,8 +41,16 @@ Status LazyInitSegmentIterator::init(const StorageReadOptions& opts) { | |
| std::shared_ptr<Segment> segment; | ||
| { | ||
| SegmentCacheHandle segment_cache_handle; | ||
| RETURN_IF_ERROR(SegmentLoader::instance()->load_segment( | ||
| _rowset, _segment_id, &segment_cache_handle, _should_use_cache, false, opts.stats)); | ||
| auto st = SegmentLoader::instance()->load_segment( | ||
| _rowset, _segment_id, &segment_cache_handle, _should_use_cache, false, opts.stats); | ||
| if ((st.is<ErrorCode::NOT_FOUND>() || st.is<ErrorCode::IO_ERROR>()) && | ||
| config::ignore_not_found_segment) { | ||
| LOG(WARNING) << "segment io error, skip it. rowset_id=" << _rowset->rowset_id() | ||
| << ", seg_id=" << _segment_id << ", status=" << st; | ||
| // _inner_iterator remains nullptr, next_batch() will return EOF | ||
| return Status::OK(); | ||
| } | ||
| RETURN_IF_ERROR(st); | ||
|
Comment on lines
+44
to
+53
|
||
| const auto& tmp_segments = segment_cache_handle.get_segments(); | ||
| segment = tmp_segments[0]; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new config name
ignore_not_found_segmentis misleading because the behavior (and comment) also includesIO_ERROR, not just missing segments. Since this is a newly introduced config, consider renaming it to something likeignore_segment_io_errors(or otherwise aligning the name strictly to NOT_FOUND-only behavior) to avoid operator confusion when toggling at runtime.