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

lide 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 11aab648a3c [fix](crash) be crash because of duplicate 
__PARTIAL_UPDATE_AUTO_INC_COLUMN__ (#41172) (#41187)
11aab648a3c is described below

commit 11aab648a3cc1c2055c36298f88448fb579ffd2d
Author: camby <camby...@tencent.com>
AuthorDate: Wed Sep 25 19:49:57 2024 +0800

    [fix](crash) be crash because of duplicate 
__PARTIAL_UPDATE_AUTO_INC_COLUMN__ (#41172) (#41187)
---
 be/src/common/consts.h                                    | 1 +
 be/src/olap/rowset/segment_v2/segment_writer.cpp          | 3 ++-
 be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp | 3 ++-
 be/src/vec/sink/vtablet_block_convertor.cpp               | 9 +++++++--
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/be/src/common/consts.h b/be/src/common/consts.h
index dfee235e37b..2ec9ae12679 100644
--- a/be/src/common/consts.h
+++ b/be/src/common/consts.h
@@ -29,6 +29,7 @@ const std::string BLOCK_TEMP_COLUMN_SCANNER_FILTERED = 
"__TEMP__scanner_filtered
 const std::string ROWID_COL = "__DORIS_ROWID_COL__";
 const std::string ROW_STORE_COL = "__DORIS_ROW_STORE_COL__";
 const std::string DYNAMIC_COLUMN_NAME = "__DORIS_DYNAMIC_COL__";
+const std::string PARTIAL_UPDATE_AUTO_INC_COL = 
"__PARTIAL_UPDATE_AUTO_INC_COLUMN__";
 
 /// The maximum precision representable by a 4-byte decimal (Decimal4Value)
 constexpr int MAX_DECIMAL32_PRECISION = 9;
diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp 
b/be/src/olap/rowset/segment_v2/segment_writer.cpp
index 5028b596677..5c489502239 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp
@@ -29,6 +29,7 @@
 // IWYU pragma: no_include <opentelemetry/common/threadlocal.h>
 #include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
+#include "common/consts.h"
 #include "common/logging.h" // LOG
 #include "common/status.h"
 #include "gutil/port.h"
@@ -722,7 +723,7 @@ Status 
SegmentWriter::fill_missing_columns(vectorized::MutableColumns& mutable_f
                             mutable_full_columns[cids_missing[i]].get());
                     auto_inc_column->insert(
                             (assert_cast<const vectorized::ColumnInt64*>(
-                                     
block->get_by_name("__PARTIAL_UPDATE_AUTO_INC_COLUMN__")
+                                     
block->get_by_name(BeConsts::PARTIAL_UPDATE_AUTO_INC_COL)
                                              .column.get()))
                                     ->get_element(idx));
                 } else {
diff --git a/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp 
b/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
index 4ee0decabd2..202c859804b 100644
--- a/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/vertical_segment_writer.cpp
@@ -29,6 +29,7 @@
 
 #include "common/compiler_util.h" // IWYU pragma: keep
 #include "common/config.h"
+#include "common/consts.h"
 #include "common/logging.h" // LOG
 #include "gutil/port.h"
 #include "inverted_index_fs_directory.h"
@@ -665,7 +666,7 @@ Status VerticalSegmentWriter::_fill_missing_columns(
                             mutable_full_columns[missing_cids[i]].get());
                     auto_inc_column->insert(
                             (assert_cast<const vectorized::ColumnInt64*>(
-                                     
block->get_by_name("__PARTIAL_UPDATE_AUTO_INC_COLUMN__")
+                                     
block->get_by_name(BeConsts::PARTIAL_UPDATE_AUTO_INC_COL)
                                              .column.get()))
                                     ->get_element(idx));
                 } else {
diff --git a/be/src/vec/sink/vtablet_block_convertor.cpp 
b/be/src/vec/sink/vtablet_block_convertor.cpp
index 57ec77a38e2..9a59d45568b 100644
--- a/be/src/vec/sink/vtablet_block_convertor.cpp
+++ b/be/src/vec/sink/vtablet_block_convertor.cpp
@@ -29,6 +29,7 @@
 #include <utility>
 
 #include "common/compiler_util.h" // IWYU pragma: keep
+#include "common/consts.h"
 #include "common/status.h"
 #include "runtime/descriptors.h"
 #include "runtime/runtime_state.h"
@@ -561,6 +562,10 @@ Status 
OlapTableBlockConvertor::_fill_auto_inc_cols(vectorized::Block* block, si
 
 Status 
OlapTableBlockConvertor::_partial_update_fill_auto_inc_cols(vectorized::Block* 
block,
                                                                    size_t 
rows) {
+    // avoid duplicate PARTIAL_UPDATE_AUTO_INC_COL
+    if (block->has(BeConsts::PARTIAL_UPDATE_AUTO_INC_COL)) {
+        return Status::OK();
+    }
     auto dst_column = vectorized::ColumnInt64::create();
     vectorized::ColumnInt64::Container& dst_values = dst_column->get_data();
     size_t null_value_count = rows;
@@ -575,8 +580,8 @@ Status 
OlapTableBlockConvertor::_partial_update_fill_auto_inc_cols(vectorized::B
     }
     block->insert(vectorized::ColumnWithTypeAndName(std::move(dst_column),
                                                     
std::make_shared<DataTypeNumber<Int64>>(),
-                                                    
"__PARTIAL_UPDATE_AUTO_INC_COLUMN__"));
+                                                    
BeConsts::PARTIAL_UPDATE_AUTO_INC_COL));
     return Status::OK();
 }
 
-} // namespace doris::vectorized
\ No newline at end of file
+} // namespace doris::vectorized


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

Reply via email to