fix can't generate parallel rowkey range for empty major

This commit is contained in:
yangqise7en
2024-03-01 03:45:02 +00:00
committed by ob-robot
parent 34adce1719
commit d1a1522962
5 changed files with 14 additions and 4 deletions

View File

@ -693,15 +693,18 @@ int ObMediumCompactionScheduleFunc::init_parallel_range_and_schema_changed(
} else {
const int64_t macro_block_cnt = first_sstable->get_data_macro_block_count();
int64_t inc_row_cnt = 0;
int64_t inc_macro_cnt = 0;
for (int64_t i = 0; OB_SUCC(ret) && i < result.handle_.get_count(); ++i) {
inc_row_cnt += static_cast<const ObSSTable*>(result.handle_.get_table(i))->get_row_count();
inc_macro_cnt += static_cast<const ObSSTable*>(result.handle_.get_table(i))->get_data_macro_block_count();
}
if (OB_FAIL(ret)) {
} else if ((0 == macro_block_cnt && inc_row_cnt > SCHEDULE_RANGE_ROW_COUNT_THRESHOLD)
|| (first_sstable->get_row_count() >= SCHEDULE_RANGE_ROW_COUNT_THRESHOLD
&& inc_row_cnt >= first_sstable->get_row_count() * SCHEDULE_RANGE_INC_ROW_COUNT_PERCENRAGE_THRESHOLD)) {
if (OB_FAIL(ObParallelMergeCtx::get_concurrent_cnt(tablet_size, macro_block_cnt, expected_task_count))) {
const int64_t estimate_macro_cnt = macro_block_cnt + inc_macro_cnt / 5;
if (OB_FAIL(ObParallelMergeCtx::get_concurrent_cnt(tablet_size, estimate_macro_cnt, expected_task_count))) {
STORAGE_LOG(WARN, "failed to get concurrent cnt", K(ret), K(tablet_size), K(expected_task_count),
KPC(first_sstable));
}

View File

@ -249,6 +249,7 @@ int ObTabletMediumCompactionInfoRecorder::inner_replay_clog(
} else if (OB_FAIL(replay_executor.execute(scn, ls_id_, tablet_id_))) {
if (OB_TABLET_NOT_EXIST == ret || OB_NO_NEED_UPDATE == ret) {
ret = OB_SUCCESS;
LOG_INFO("skip reply medium info", KR(ret), K(replay_medium_info));
} else {
LOG_WARN("failed to replay medium info", K(ret), K(replay_medium_info));
}