From 801e751520f50b19d3c904be54db7b19d0924377 Mon Sep 17 00:00:00 2001 From: simonjoylet Date: Mon, 1 Jul 2024 07:04:57 +0000 Subject: [PATCH] free slice writer after fill column group data --- .../ddl/ob_direct_insert_sstable_ctx_new.cpp | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp b/src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp index 73e8fe45d3..8cfeffa255 100644 --- a/src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp +++ b/src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp @@ -2038,21 +2038,16 @@ int ObTabletDirectLoadMgr::close_sstable_slice( } } if (OB_NOT_NULL(slice_writer)) { - if (OB_SUCC(ret) && is_data_direct_load(direct_load_type_) && slice_writer->need_column_store()) { - //ignore, free after rescan + int tmp_ret = OB_SUCCESS; + if (OB_TMP_FAIL(sqc_build_ctx_.slice_mgr_map_.erase_refactored(slice_info.slice_id_))) { + LOG_ERROR("erase failed", K(ret), K(tmp_ret), K(slice_info)); } else { - // for ddl, delete slice_writer regardless of success or failure - int tmp_ret = OB_SUCCESS; - if (OB_TMP_FAIL(sqc_build_ctx_.slice_mgr_map_.erase_refactored(slice_info.slice_id_))) { - LOG_ERROR("erase failed", K(ret), K(tmp_ret), K(slice_info)); - } else { - LOG_INFO("erase a slice writer", K(ret), KP(slice_writer), K(sqc_build_ctx_.slice_mgr_map_.size())); - slice_writer->~ObDirectLoadSliceWriter(); - sqc_build_ctx_.slice_writer_allocator_.free(slice_writer); - slice_writer = nullptr; - } - ret = OB_SUCC(ret) ? tmp_ret : ret; + LOG_INFO("erase a slice writer", K(ret), KP(slice_writer), K(sqc_build_ctx_.slice_mgr_map_.size())); + slice_writer->~ObDirectLoadSliceWriter(); + sqc_build_ctx_.slice_writer_allocator_.free(slice_writer); + slice_writer = nullptr; } + ret = OB_SUCC(ret) ? tmp_ret : ret; } } return ret;