zhannngchen commented on code in PR #12666:
URL: https://github.com/apache/doris/pull/12666#discussion_r972945037


##########
be/src/runtime/tablets_channel.cpp:
##########
@@ -237,8 +238,22 @@ Status TabletsChannel::reduce_mem_usage(int64_t mem_limit) 
{
         }
     }
     VLOG_CRITICAL << "flush " << counter << " memtables to reduce memory: " << 
sum;
+    google::protobuf::RepeatedPtrField<PTabletError>* tablet_errors =
+            response->mutable_tablet_errors();
     for (int i = 0; i < counter; i++) {
-        writers[i]->flush_memtable_and_wait(false);
+        Status st = writers[i]->flush_memtable_and_wait(false);
+        if (!st.ok()) {
+            auto err_msg = strings::Substitute(
+                    "tablet writer failed to reduce mem consumption by 
flushing memtable, "
+                    "tablet_id=$0, txn_id=$1, err=$2, errcode=$3, msg:$4",
+                    writers[i]->tablet_id(), _txn_id, st.code(), 
st.precise_code(),
+                    st.get_error_msg());
+            LOG(WARNING) << err_msg;
+            PTabletError* error = tablet_errors->Add();
+            error->set_tablet_id(writers[i]->tablet_id());
+            error->set_msg(err_msg);
+            _broken_tablets.insert(writers[i]->tablet_id());
+        }

Review Comment:
   If some error happened while `flush_memtable_and_wait`, we should not call 
`wait_flush` in L260, in that situation, `wait_flush` might wait infinitely?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to