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


##########
be/src/olap/memtable.cpp:
##########
@@ -144,16 +144,15 @@ void MemTable::_init_agg_functions(const 
vectorized::Block* block) {
 }
 
 MemTable::~MemTable() {
-    if (_vec_skip_list != nullptr && _keys_type != KeysType::DUP_KEYS) {
-        VecTable::Iterator it(_vec_skip_list.get());
-        for (it.SeekToFirst(); it.Valid(); it.Next()) {
+    if (!_row_in_blocks.empty() && _keys_type != KeysType::DUP_KEYS) {
+        for (auto it = _row_in_blocks.begin(); it != _row_in_blocks.end(); 
it++) {
             // We should release agg_places here, because they are not 
released when a
             // load is canceled.
             for (size_t i = _schema->num_key_columns(); i < _num_columns; ++i) 
{
                 auto function = _agg_functions[i];
                 DCHECK(function != nullptr);
-                DCHECK(it.key()->agg_places(i) != nullptr);
-                function->destroy(it.key()->agg_places(i));
+                DCHECK((*it)->agg_places(i) != nullptr);
+                function->destroy((*it)->agg_places(i));

Review Comment:
   If writes stop and just destruct then, there is no agg_places, dcheck here 
does not work.



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