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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to