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

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


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

commit a629f41d5aca9cf5dc5f056266903ee92671d057
Author: HappenLee <[email protected]>
AuthorDate: Tue Jul 22 19:44:39 2025 +0800

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

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 46e68829558..0c83fc76e13 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1966,6 +1966,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/exec/rowid_fetcher.cpp b/be/src/exec/rowid_fetcher.cpp
index b26ad63d71b..d6c47201dad 100644
--- a/be/src/exec/rowid_fetcher.cpp
+++ b/be/src/exec/rowid_fetcher.cpp
@@ -442,9 +442,13 @@ Status RowIdStorageReader::read_by_rowids(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
diff --git a/be/src/olap/rowset/segment_v2/segment.cpp 
b/be/src/olap/rowset/segment_v2/segment.cpp
index 86884d7adce..e29ec890814 100644
--- a/be/src/olap/rowset/segment_v2/segment.cpp
+++ b/be/src/olap/rowset/segment_v2/segment.cpp
@@ -1125,6 +1125,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()},


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

Reply via email to