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

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

commit 72cee27e8c06e2fea0a555ee113d625e38835d0b
Author: abmdocrt <[email protected]>
AuthorDate: Fri Sep 22 19:48:42 2023 +0800

    [Fix](core) Fix segment cache core when output rowset is nullptr (#24778)
---
 be/src/olap/compaction.cpp | 16 +++++++++++-----
 be/src/olap/compaction.h   |  2 +-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index d68a80545c3..45711decfda 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -134,7 +134,9 @@ Status Compaction::do_compaction(int64_t permits) {
                          << ", before=" << checksum_before << ", 
checksum_after=" << checksum_after;
         }
     }
-    _load_segment_to_cache();
+    if (st.ok()) {
+        _load_segment_to_cache();
+    }
     return st;
 }
 
@@ -831,12 +833,16 @@ int64_t Compaction::get_compaction_permits() {
     return permits;
 }
 
-Status Compaction::_load_segment_to_cache() {
+void Compaction::_load_segment_to_cache() {
     // Load new rowset's segments to cache.
     SegmentCacheHandle handle;
-    RETURN_IF_ERROR(SegmentLoader::instance()->load_segments(
-            std::static_pointer_cast<BetaRowset>(_output_rowset), &handle, 
true));
-    return Status::OK();
+    auto st = SegmentLoader::instance()->load_segments(
+            std::static_pointer_cast<BetaRowset>(_output_rowset), &handle, 
true);
+    if (!st.ok()) {
+        LOG(WARNING) << "failed to load segment to cache! output rowset 
version="
+                     << _output_rowset->start_version() << "-" << 
_output_rowset->end_version()
+                     << ".";
+    }
 }
 
 #ifdef BE_TEST
diff --git a/be/src/olap/compaction.h b/be/src/olap/compaction.h
index afb4f27e7ff..ad29430fec6 100644
--- a/be/src/olap/compaction.h
+++ b/be/src/olap/compaction.h
@@ -99,7 +99,7 @@ protected:
 
 private:
     bool _check_if_includes_input_rowsets(const RowsetIdUnorderedSet& 
commit_rowset_ids_set) const;
-    Status _load_segment_to_cache();
+    void _load_segment_to_cache();
 
 protected:
     // the root tracker for this compaction


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

Reply via email to