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/20 06:27:44 UTC
[doris] branch master updated: [fix](load) add missing flush context for BetaRowsetWriter::_add_block() (#20884)
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 012813b3f7 [fix](load) add missing flush context for BetaRowsetWriter::_add_block() (#20884)
012813b3f7 is described below
commit 012813b3f7a9d1ae7749400cb6656f3227c8567b
Author: Kaijie Chen <ck...@apache.org>
AuthorDate: Tue Jun 20 14:27:39 2023 +0800
[fix](load) add missing flush context for BetaRowsetWriter::_add_block() (#20884)
---
be/src/olap/rowset/beta_rowset_writer.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp
index 680645d751..9e79f9287b 100644
--- a/be/src/olap/rowset/beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/beta_rowset_writer.cpp
@@ -491,8 +491,15 @@ Status BetaRowsetWriter::flush_single_memtable(const vectorized::Block* block, i
std::unique_ptr<segment_v2::SegmentWriter> writer;
RETURN_IF_ERROR(_create_segment_writer(&writer, ctx));
+ segment_v2::SegmentWriter* raw_writer = writer.get();
int32_t segment_id = writer->get_segment_id();
- RETURN_IF_ERROR(_add_block(block, &writer));
+ RETURN_IF_ERROR(_add_block(block, &writer, ctx));
+ // if segment_id is present in flush context,
+ // the entire memtable should be flushed into a single segment
+ if (ctx != nullptr && ctx->segment_id.has_value()) {
+ DCHECK_EQ(writer->get_segment_id(), segment_id);
+ DCHECK_EQ(writer.get(), raw_writer);
+ }
RETURN_IF_ERROR(_flush_segment_writer(&writer, flush_size));
if (ctx != nullptr && ctx->generate_delete_bitmap) {
RETURN_IF_ERROR(ctx->generate_delete_bitmap(segment_id));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org