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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 4afc72a440a branch-3.1: [Opt](config) Add a config for min buffer size 
to flush for partial update #53841 (#53932)
4afc72a440a is described below

commit 4afc72a440a03d71ca55b33630984ea29bcb8f39
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jul 28 10:35:01 2025 +0800

    branch-3.1: [Opt](config) Add a config for min buffer size to flush for 
partial update #53841 (#53932)
    
    Cherry-picked from #53841
    
    Co-authored-by: bobhan1 <[email protected]>
---
 be/src/common/config.cpp | 2 ++
 be/src/common/config.h   | 2 ++
 be/src/olap/memtable.cpp | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 3a37d43756d..fc1de3d1bce 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -672,6 +672,8 @@ DEFINE_mInt32(memory_gc_sleep_time_ms, "500");
 DEFINE_mInt64(write_buffer_size, "209715200");
 // max buffer size used in memtable for the aggregated table, default 400MB
 DEFINE_mInt64(write_buffer_size_for_agg, "419430400");
+
+DEFINE_mInt64(min_write_buffer_size_for_partial_update, "1048576");
 // max parallel flush task per memtable writer
 DEFINE_mInt32(memtable_flush_running_count_limit, "2");
 
diff --git a/be/src/common/config.h b/be/src/common/config.h
index a62a1933ed4..1ee4b9d6821 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -715,6 +715,8 @@ DECLARE_mInt32(memory_gc_sleep_time_ms);
 DECLARE_mInt64(write_buffer_size);
 // max buffer size used in memtable for the aggregated table, default 400MB
 DECLARE_mInt64(write_buffer_size_for_agg);
+
+DECLARE_mInt64(min_write_buffer_size_for_partial_update);
 // max parallel flush task per memtable writer
 DECLARE_mInt32(memtable_flush_running_count_limit);
 
diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp
index c999e4f3302..15d33a5b73c 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -641,8 +641,9 @@ bool MemTable::need_flush() const {
     auto max_size = config::write_buffer_size;
     if (_partial_update_mode == UniqueKeyUpdateModePB::UPDATE_FIXED_COLUMNS) {
         auto update_columns_size = _num_columns;
+        auto min_buffer_size = 
config::min_write_buffer_size_for_partial_update;
         max_size = max_size * update_columns_size / 
_tablet_schema->num_columns();
-        max_size = max_size > 1048576 ? max_size : 1048576;
+        max_size = max_size > min_buffer_size ? max_size : min_buffer_size;
     }
     return memory_usage() >= max_size;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to