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/30 09:17:54 UTC
[incubator-doris] branch master updated: Need to check the return
status of push_memtable (#2328)
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 6fbb5b3 Need to check the return status of push_memtable (#2328)
6fbb5b3 is described below
commit 6fbb5b31fadfd92160955b55417a131f4f2a8ff6
Author: LingBin <li...@gmail.com>
AuthorDate: Sat Nov 30 03:17:46 2019 -0600
Need to check the return status of push_memtable (#2328)
When `BlockingQueue` is shutdown, the `blocking_put()` will return false,
we could not ignore it.
---
be/src/olap/memtable_flush_executor.cpp | 10 +++++++---
be/src/olap/memtable_flush_executor.h | 2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/be/src/olap/memtable_flush_executor.cpp b/be/src/olap/memtable_flush_executor.cpp
index f98d3ee..2399895 100644
--- a/be/src/olap/memtable_flush_executor.cpp
+++ b/be/src/olap/memtable_flush_executor.cpp
@@ -31,7 +31,7 @@ OLAPStatus FlushHandler::submit(std::shared_ptr<MemTable> memtable) {
ctx.memtable = memtable;
ctx.flush_handler = this->shared_from_this();
_counter_cond.inc();
- _flush_executor->_push_memtable(_flush_queue_idx, ctx);
+ RETURN_NOT_OK(_flush_executor->_push_memtable(_flush_queue_idx, ctx));
return OLAP_SUCCESS;
}
@@ -118,8 +118,12 @@ size_t MemTableFlushExecutor::_get_queue_idx(size_t path_hash) {
return cur_idx;
}
-void MemTableFlushExecutor::_push_memtable(int32_t queue_idx, MemTableFlushContext& ctx) {
- _flush_queues[queue_idx]->blocking_put(ctx);
+OLAPStatus MemTableFlushExecutor::_push_memtable(int32_t queue_idx, MemTableFlushContext& ctx) {
+ if (!_flush_queues[queue_idx]->blocking_put(ctx)) {
+ return OLAP_ERR_OTHER_ERROR;
+ }
+
+ return OLAP_SUCCESS;
}
void MemTableFlushExecutor::_flush_memtable(int32_t queue_idx) {
diff --git a/be/src/olap/memtable_flush_executor.h b/be/src/olap/memtable_flush_executor.h
index 76f91fe..74a33fa 100644
--- a/be/src/olap/memtable_flush_executor.h
+++ b/be/src/olap/memtable_flush_executor.h
@@ -149,7 +149,7 @@ private:
size_t _get_queue_idx(size_t path_hash);
// push the memtable to specified flush queue
- void _push_memtable(int32_t queue_idx, MemTableFlushContext& ctx);
+ OLAPStatus _push_memtable(int32_t queue_idx, MemTableFlushContext& ctx);
void _flush_memtable(int32_t queue_idx);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org