free slice writer after fill column group data

This commit is contained in:
simonjoylet
2024-07-01 07:04:57 +00:00
committed by ob-robot
parent a23bcd2c9c
commit 801e751520

View File

@ -2038,21 +2038,16 @@ int ObTabletDirectLoadMgr::close_sstable_slice(
} }
} }
if (OB_NOT_NULL(slice_writer)) { if (OB_NOT_NULL(slice_writer)) {
if (OB_SUCC(ret) && is_data_direct_load(direct_load_type_) && slice_writer->need_column_store()) { int tmp_ret = OB_SUCCESS;
//ignore, free after rescan 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 { } else {
// for ddl, delete slice_writer regardless of success or failure LOG_INFO("erase a slice writer", K(ret), KP(slice_writer), K(sqc_build_ctx_.slice_mgr_map_.size()));
int tmp_ret = OB_SUCCESS; slice_writer->~ObDirectLoadSliceWriter();
if (OB_TMP_FAIL(sqc_build_ctx_.slice_mgr_map_.erase_refactored(slice_info.slice_id_))) { sqc_build_ctx_.slice_writer_allocator_.free(slice_writer);
LOG_ERROR("erase failed", K(ret), K(tmp_ret), K(slice_info)); slice_writer = nullptr;
} 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;
} }
ret = OB_SUCC(ret) ? tmp_ret : ret;
} }
} }
return ret; return ret;