You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by zh...@apache.org on 2019/11/14 13:40:23 UTC

[incubator-doris] branch master updated: Fix npe when segment writer init failed (#2202)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8b7735f  Fix npe when segment writer init failed (#2202)
8b7735f is described below

commit 8b7735f7e9359e1af52edf66f9fa3ab2de83327f
Author: kangpinghuang <kp...@163.com>
AuthorDate: Thu Nov 14 21:40:18 2019 +0800

    Fix npe when segment writer init failed (#2202)
---
 be/src/olap/rowset/beta_rowset_writer.cpp |  1 +
 be/src/olap/schema_change.cpp             | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp
index 69bcbf9..2bff724 100644
--- a/be/src/olap/rowset/beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/beta_rowset_writer.cpp
@@ -164,6 +164,7 @@ OLAPStatus BetaRowsetWriter::_create_segment_writer() {
     auto s = _segment_writer->init(config::push_write_mbytes_per_sec);
     if (!s.ok()) {
         LOG(WARNING) << "failed to init segment writer: " << s.to_string();
+        _segment_writer.reset(nullptr);
         return OLAP_ERR_INIT_FAILED;
     }
     _num_segment++;
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 2cd5a45..344524b 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -587,7 +587,10 @@ bool RowBlockMerger::merge(
         }
 
         if (KeysType::DUP_KEYS == _tablet->keys_type()) {
-            rowset_writer->add_row(row_cursor);
+            if (rowset_writer->add_row(row_cursor) != OLAP_SUCCESS) {
+                LOG(WARNING) << "fail to add row to rowset writer.";
+                goto MERGE_ERR;
+            }
             continue;
         }
 
@@ -601,7 +604,10 @@ bool RowBlockMerger::merge(
             }
         }
         agg_finalize_row(&row_cursor, mem_pool.get());
-        rowset_writer->add_row(row_cursor);
+        if (rowset_writer->add_row(row_cursor) != OLAP_SUCCESS) {
+            LOG(WARNING) << "fail to add row to rowset writer.";
+            goto MERGE_ERR;
+        }
 
         // the memory allocate by mem pool has been copied,
         // so we should release memory immediately


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