kaijchen commented on code in PR #19099:
URL: https://github.com/apache/doris/pull/19099#discussion_r1201615144


##########
be/src/olap/memtable.cpp:
##########
@@ -425,6 +443,7 @@ Status MemTable::flush() {
     // and use the ids to load segment data file for calc delete bitmap.
     int64_t atomic_num_segments_before_flush = 
_rowset_writer->get_atomic_num_segment();
     RETURN_IF_ERROR(_do_flush(duration_ns));
+    _delta_writer_callback(_merged_rows);

Review Comment:
   OK I got it, `_mem_table->merged_rows()` was updated in 
`MemTable::_do_flush()`.
   
   ```cpp
       RETURN_IF_ERROR(_do_flush(duration_ns));
       delta_writer_callback(_merged_rows);
   ```
   
   The question is, will it be added twice?
   
   ```cpp
   // in DeltaWriter::_flush_memtable_async()
       _merged_rows += _mem_table->merged_rows(); // what if merged_rows() is 
non-zero here?
   
   // in MemTable::flush() or MemTable::need_flush()
       _delta_writer_callback(_merged_rows)
   ```
   
   I wonder if there is a better way to make this more clear to read.
   



-- 
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