GoGoWen commented on a change in pull request #6932:
URL: https://github.com/apache/incubator-doris/pull/6932#discussion_r736205735



##########
File path: be/src/olap/schema_change.cpp
##########
@@ -1184,6 +1196,16 @@ OLAPStatus 
SchemaChangeWithSorting::process(RowsetReaderSharedPtr rowset_reader,
                                                            true)) {
             LOG(WARNING) << "failed to allocate RowBlock.";
             return OLAP_ERR_INPUT_PARAMETER_ERROR;
+        }else {
+            // do memory check for sorting, in case schema change task fail at 
row block sorting because of 
+            // not doing internal sorting first
+            if 
(!_row_block_allocator->is_memory_enough_for_sorting(ref_row_block->row_block_info().row_num,
+                                                                
row_block_sorter.num_rows())) {
+                if (new_row_block != nullptr) {
+                    _row_block_allocator->release(new_row_block);
+                    new_row_block = nullptr;
+                }

Review comment:
       set new_row_block to nullptr, in order to do internal sorting to release 
memory. 




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