You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2023/06/08 09:40:09 UTC

[doris] branch master updated: [fix](load) fix ctx nullptr core in flush_single_memtable (#20573)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3054574bc1 [fix](load) fix ctx nullptr core in flush_single_memtable (#20573)
3054574bc1 is described below

commit 3054574bc1020012713a3da63d79fccbb8339d57
Author: Kaijie Chen <ck...@apache.org>
AuthorDate: Thu Jun 8 17:40:02 2023 +0800

    [fix](load) fix ctx nullptr core in flush_single_memtable (#20573)
---
 be/src/olap/rowset/beta_rowset_writer.cpp | 4 +++-
 be/src/olap/rowset/rowset_writer.h        | 4 +---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp
index 4e462f1e4b..7f330a80b7 100644
--- a/be/src/olap/rowset/beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/beta_rowset_writer.cpp
@@ -494,7 +494,9 @@ Status BetaRowsetWriter::flush_single_memtable(const vectorized::Block* block, i
     int32_t segment_id = writer->get_segment_id();
     RETURN_IF_ERROR(_add_block(block, &writer));
     RETURN_IF_ERROR(_flush_segment_writer(&writer, flush_size));
-    RETURN_IF_ERROR(ctx->generate_delete_bitmap(segment_id));
+    if (ctx != nullptr && ctx->generate_delete_bitmap) {
+        RETURN_IF_ERROR(ctx->generate_delete_bitmap(segment_id));
+    }
     RETURN_IF_ERROR(_segcompaction_if_necessary());
     return Status::OK();
 }
diff --git a/be/src/olap/rowset/rowset_writer.h b/be/src/olap/rowset/rowset_writer.h
index 3ccd481ec7..aea4a05bcc 100644
--- a/be/src/olap/rowset/rowset_writer.h
+++ b/be/src/olap/rowset/rowset_writer.h
@@ -41,9 +41,7 @@ struct FlushContext {
     TabletSchemaSPtr flush_schema = nullptr;
     const vectorized::Block* block = nullptr;
     std::optional<int32_t> segment_id = std::nullopt;
-    std::function<Status(int32_t)> generate_delete_bitmap = [](int32_t segment_id) {
-        return Status::OK();
-    };
+    std::function<Status(int32_t)> generate_delete_bitmap;
 };
 
 class RowsetWriter {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org