This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 8c850274bbc [Bug](topn) variant column read in topn may coredump 
(#52583)
8c850274bbc is described below

commit 8c850274bbcba86d464a8ade527a696b2290e670
Author: HappenLee <[email protected]>
AuthorDate: Thu Jul 3 17:59:12 2025 +0800

    [Bug](topn) variant column read in topn may coredump (#52583)
    
    ### What problem does this PR solve?
    
    cherry pick #52573
    Problem Summary:
---
 be/src/common/config.cpp                  |  2 ++
 be/src/olap/rowset/segment_v2/segment.cpp |  4 ++++
 be/src/service/internal_service.cpp       | 10 +++++++---
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 659324813a7..fa8e5e92722 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1812,6 +1812,8 @@ Status set_fuzzy_configs() {
     // if have set enable_fuzzy_mode=true in be.conf, will fuzzy those field 
and values
     fuzzy_field_and_value["disable_storage_page_cache"] =
             ((distribution(*generator) % 2) == 0) ? "true" : "false";
+    fuzzy_field_and_value["disable_segment_cache"] =
+            ((distribution(*generator) % 2) == 0) ? "true" : "false";
     fuzzy_field_and_value["enable_system_metrics"] =
             ((distribution(*generator) % 2) == 0) ? "true" : "false";
     fuzzy_field_and_value["enable_set_in_bitmap_value"] =
diff --git a/be/src/olap/rowset/segment_v2/segment.cpp 
b/be/src/olap/rowset/segment_v2/segment.cpp
index 1f98eafd6fc..c7be3456d13 100644
--- a/be/src/olap/rowset/segment_v2/segment.cpp
+++ b/be/src/olap/rowset/segment_v2/segment.cpp
@@ -898,6 +898,10 @@ Status Segment::seek_and_read_by_rowid(const TabletSchema& 
schema, SlotDescripto
         vectorized::PathInDataPtr path = 
std::make_shared<vectorized::PathInData>(
                 schema.column_by_uid(slot->col_unique_id()).name_lower_case(),
                 slot->column_paths());
+
+        // here need create column readers to make sure column reader is 
created before seek_and_read_by_rowid
+        // if segment cache miss, column reader will be created to make sure 
the variant column result not coredump
+        RETURN_IF_ERROR(_create_column_readers_once(&stats));
         auto storage_type = get_data_type_of(ColumnIdentifier {.unique_id = 
slot->col_unique_id(),
                                                                .path = path,
                                                                .is_nullable = 
slot->is_nullable()},
diff --git a/be/src/service/internal_service.cpp 
b/be/src/service/internal_service.cpp
index 7156439c2ad..acbaecddcbd 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -2191,9 +2191,13 @@ Status PInternalServiceImpl::_multi_get(const 
PMultiGetRequest& request,
                 iterator_map[iterator_key].segment = segment;
             }
             segment = iterator_item.segment;
-            RETURN_IF_ERROR(segment->seek_and_read_by_rowid(full_read_schema, 
desc.slots()[x],
-                                                            row_id, column, 
stats,
-                                                            
iterator_item.iterator));
+            try {
+                
RETURN_IF_ERROR(segment->seek_and_read_by_rowid(full_read_schema, 
desc.slots()[x],
+                                                                row_id, 
column, stats,
+                                                                
iterator_item.iterator));
+            } catch (const Exception& e) {
+                return Status::Error<false>(e.code(), "Row id fetch failed 
because {}", e.what());
+            }
         }
     }
     // serialize block if not empty


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to