Fix prefetch micro block that size bigger than batch size

This commit is contained in:
DengzhiLiu 2024-06-24 09:16:49 +00:00 committed by ob-robot
parent 3cfbf0100f
commit da3fb1fa43
2 changed files with 7 additions and 11 deletions

View File

@ -1732,15 +1732,11 @@ int ObIndexTreeMultiPassPrefetcher<DATA_PREFETCH_DEPTH, INDEX_PREFETCH_DEPTH>::p
need_submit_io_))) {
LOG_WARN("Fail to prefetch data block data", K(ret));
} else if (use_multi_block_prefetch_ && micro_handle.need_multi_io()) {
bool need_split = false;
if (multi_io_params_.add_micro_data(index_block_info, prefetch_idx, micro_handle, need_split)) {
if (OB_FAIL(prefetch_multi_data_block(prefetch_idx + 1))) {
LOG_WARN("Fail to prefetch multi block", K(ret));
} else if (need_split) {
// reused after prefetch_multi_data_block
if (multi_io_params_.add_micro_data(index_block_info, prefetch_idx, micro_handle, need_split)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("Unexpected multi_io_params status", K(ret), K_(multi_io_params));
bool need_split = true;
while (OB_SUCC(ret) && need_split) {
if (multi_io_params_.add_micro_data(index_block_info, prefetch_idx, micro_handle, need_split)) {
if (OB_FAIL(prefetch_multi_data_block(prefetch_idx + 1))) {
LOG_WARN("Fail to prefetch multi block", K(ret));
}
}
}

View File

@ -274,8 +274,8 @@ int ObMultiBlockIOParam::init(
{
int ret = OB_SUCCESS;
is_reverse_ = is_reverse;
io_read_batch_size_ = iter_param.get_io_read_batch_size();
io_read_gap_size_ = iter_param.get_io_read_gap_size();
io_read_batch_size_ = MAX(iter_param.get_io_read_batch_size(), 0);
io_read_gap_size_ = MAX(iter_param.get_io_read_gap_size(), 0);
prefetch_idx_.set_allocator(&allocator);
micro_infos_.set_allocator(&allocator);
if (OB_UNLIKELY(0 >= micro_count_cap || MAX_MICRO_BLOCK_READ_COUNT < micro_count_cap)) {