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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 1d5c8335d8e [fix](load) fix 
MemTableWriter::active_memtable_mem_consumption (#25396)
1d5c8335d8e is described below

commit 1d5c8335d8ed5b0def21f9108f05c282ef64747c
Author: Kaijie Chen <[email protected]>
AuthorDate: Fri Oct 13 11:50:02 2023 +0800

    [fix](load) fix MemTableWriter::active_memtable_mem_consumption (#25396)
---
 be/src/olap/delta_writer.cpp | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/be/src/olap/delta_writer.cpp b/be/src/olap/delta_writer.cpp
index 2f77c031d2e..305550fb415 100644
--- a/be/src/olap/delta_writer.cpp
+++ b/be/src/olap/delta_writer.cpp
@@ -626,20 +626,7 @@ int64_t DeltaWriter::mem_consumption(MemType mem) {
 }
 
 int64_t DeltaWriter::active_memtable_mem_consumption() {
-    if (_flush_token == nullptr) {
-        // This method may be called before this writer is initialized.
-        // So _flush_token may be null.
-        return 0;
-    }
-    int64_t mem_usage = 0;
-    {
-        std::lock_guard<SpinLock> l(_mem_table_tracker_lock);
-        if (_mem_table_insert_trackers.size() > 0) {
-            mem_usage += (*_mem_table_insert_trackers.rbegin())->consumption();
-            mem_usage += (*_mem_table_flush_trackers.rbegin())->consumption();
-        }
-    }
-    return mem_usage;
+    return _mem_table != nullptr ? _mem_table->memory_usage() : 0;
 }
 
 int64_t DeltaWriter::partition_id() const {


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

Reply via email to