You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/01/11 07:16:51 UTC
[doris] branch branch-1.1-lts updated: [branch-1.1-lts](unique key) disable concurrent flush memtable for unique key (#15804)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
new 3d3d127777 [branch-1.1-lts](unique key) disable concurrent flush memtable for unique key (#15804)
3d3d127777 is described below
commit 3d3d12777705d0f356c9548123da9233038825f4
Author: zhannngchen <48...@users.noreply.github.com>
AuthorDate: Wed Jan 11 15:16:43 2023 +0800
[branch-1.1-lts](unique key) disable concurrent flush memtable for unique key (#15804)
---
be/src/olap/delta_writer.cpp | 5 +++--
be/src/olap/memtable_flush_executor.cpp | 10 +++++-----
be/src/olap/memtable_flush_executor.h | 6 +++---
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/be/src/olap/delta_writer.cpp b/be/src/olap/delta_writer.cpp
index fb2f69a235..eff82c4f22 100644
--- a/be/src/olap/delta_writer.cpp
+++ b/be/src/olap/delta_writer.cpp
@@ -149,8 +149,9 @@ OLAPStatus DeltaWriter::init() {
_reset_mem_table();
// create flush handler
- RETURN_NOT_OK(_storage_engine->memtable_flush_executor()->create_flush_token(&_flush_token,
- writer_context.rowset_type, _req.is_high_priority));
+ bool should_serial = _tablet->keys_type() == KeysType::UNIQUE_KEYS;
+ RETURN_NOT_OK(_storage_engine->memtable_flush_executor()->create_flush_token(
+ &_flush_token, writer_context.rowset_type, should_serial, _req.is_high_priority));
_is_init = true;
return OLAP_SUCCESS;
diff --git a/be/src/olap/memtable_flush_executor.cpp b/be/src/olap/memtable_flush_executor.cpp
index 4158f1d51e..2cfeba61c7 100644
--- a/be/src/olap/memtable_flush_executor.cpp
+++ b/be/src/olap/memtable_flush_executor.cpp
@@ -106,11 +106,11 @@ void MemTableFlushExecutor::init(const std::vector<DataDir*>& data_dirs) {
}
// NOTE: we use SERIAL mode here to ensure all mem-tables from one tablet are flushed in order.
-OLAPStatus MemTableFlushExecutor::create_flush_token(
- std::unique_ptr<FlushToken>* flush_token,
- RowsetTypePB rowset_type, bool is_high_priority) {
+OLAPStatus MemTableFlushExecutor::create_flush_token(std::unique_ptr<FlushToken>* flush_token,
+ RowsetTypePB rowset_type, bool should_serial,
+ bool is_high_priority) {
if (!is_high_priority) {
- if (rowset_type == BETA_ROWSET) {
+ if (rowset_type == BETA_ROWSET && !should_serial) {
// beta rowset can be flush in CONCURRENT, because each memtable using a new segment writer.
flush_token->reset(new FlushToken(_flush_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT)));
} else {
@@ -118,7 +118,7 @@ OLAPStatus MemTableFlushExecutor::create_flush_token(
flush_token->reset(new FlushToken(_flush_pool->new_token(ThreadPool::ExecutionMode::SERIAL)));
}
} else {
- if (rowset_type == BETA_ROWSET) {
+ if (rowset_type == BETA_ROWSET && !should_serial) {
// beta rowset can be flush in CONCURRENT, because each memtable using a new segment writer.
flush_token->reset(new FlushToken(_high_prio_flush_pool->new_token(ThreadPool::ExecutionMode::CONCURRENT)));
} else {
diff --git a/be/src/olap/memtable_flush_executor.h b/be/src/olap/memtable_flush_executor.h
index c880b3c307..2f2162b6af 100644
--- a/be/src/olap/memtable_flush_executor.h
+++ b/be/src/olap/memtable_flush_executor.h
@@ -101,9 +101,9 @@ public:
// because it needs path hash of each data dir.
void init(const std::vector<DataDir*>& data_dirs);
- OLAPStatus create_flush_token(
- std::unique_ptr<FlushToken>* flush_token,
- RowsetTypePB rowset_type, bool is_high_priority);
+ OLAPStatus create_flush_token(std::unique_ptr<FlushToken>* flush_token,
+ RowsetTypePB rowset_type, bool should_serial,
+ bool is_high_priority);
private:
std::unique_ptr<ThreadPool> _flush_pool;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org