提交 ea76dae8 编写于 作者: L lx0 提交者: LINGuanRen

fix ObSSTableDumpErrorInfo memleak when checksum error

上级 17fabd98
......@@ -950,6 +950,10 @@ DEF_INT(minor_freeze_times, OB_CLUSTER_PARAMETER, "100", "[0, 65535]",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_INT(minor_compact_trigger, OB_CLUSTER_PARAMETER, "2", "[0,16]", "minor_compact_trigger, Range: [0,16] in integer",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_enable_compaction_diagnose, OB_CLUSTER_PARAMETER, "False",
"enable compaction diagnose function"
"Value: True:turned on; False: turned off",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_CAP(_private_buffer_size, OB_CLUSTER_PARAMETER, "2M",
"[0B,)"
"the trigger remaining data size within transaction for immediate logging, 0B represents not trigger immediate "
......
......@@ -1726,7 +1726,9 @@ int ObPartitionMergeUtil::merge_partition(memtable::ObIMemtableCtxFactory* memct
K(ret),
K(partition_fuser->get_compact_type()),
K(*partition_fuser->get_result_row()));
ObTableDumper::print_error_info(ret, ctx, macro_row_iters);
if (GCONF._enable_compaction_diagnose) {
ObTableDumper::print_error_info(ret, ctx, macro_row_iters);
}
} else if (OB_FAIL(partition_fuser->calc_column_checksum(false))) {
LOG_WARN("Failed to calculate column checksum", K(ret));
}
......
......@@ -7691,7 +7691,7 @@ int ObPartitionStorage::validate_sstables(
} else if (OB_FAIL(validate_sstable(row_count, index_table, column_checksum_map))) {
if (OB_ERR_PRIMARY_KEY_DUPLICATE == ret) {
handle_error_index_table(*index_table, index_stats, ret);
if (OB_ERR_PRIMARY_KEY_DUPLICATE == ret) {
if (OB_ERR_PRIMARY_KEY_DUPLICATE == ret && GCONF._enable_compaction_diagnose) {
dump_error_info(*main_sstable, *index_table);
}
} else {
......
......@@ -228,8 +228,18 @@ int ObSSTableDumpErrorInfo::find_extra_row(
STORAGE_LOG(WARN, "failed to check row", K(ret));
}
++iter_row_cnt;
if (nullptr != getter) {
allocator_.free(getter);
getter = nullptr;
}
} // end of while
}
if (nullptr != scanner) {
allocator_.free(scanner);
scanner = nullptr;
}
if (OB_SUCC(ret)) {
if (found_row_cnt + sstable2.get_meta().row_count_ != sstable1.get_meta().row_count_) {
ret = OB_ERR_UNEXPECTED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册