diff --git a/be/src/common/config.h b/be/src/common/config.h index 540df3a3a8b6dd..daa36d4f55641c 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -431,10 +431,6 @@ namespace config { // and the tablet will be marked as bad, so that FE will try to repair it. CONF_Bool(auto_recover_index_loading_failure, "false"); - // This configuration is used to recover compaction under the corner case. - // If this configuration is set to true, block will seek position. - CONF_Bool(block_seek_position, "false"); - // max external scan cache batch count, means cache max_memory_cache_batch_count * batch_size row // default is 10, batch_size's defualt value is 1024 means 10 * 1024 rows will be cached CONF_Int32(max_memory_sink_batch_count, "20"); diff --git a/be/src/olap/rowset/segment_reader.cpp b/be/src/olap/rowset/segment_reader.cpp index 5e847801f916d4..19939e476c109a 100644 --- a/be/src/olap/rowset/segment_reader.cpp +++ b/be/src/olap/rowset/segment_reader.cpp @@ -289,6 +289,15 @@ OLAPStatus SegmentReader::seek_to_block( *next_block_id = _next_block_id; *eof = _eof; + // Must seek block when starts a ScanKey. + // In Doris, one block has 1024 rows. + // 1. If the previous ScanKey scan rows multiple blocks, + // and also the final block has 1024 rows just right. + // 2. The current ScanKey scan rows with number less than one block. + // Under the two conditions, if not seek block, the position + // of prefix shortkey columns is wrong. + _need_to_seek_block = true; + return OLAP_SUCCESS; } @@ -832,7 +841,7 @@ OLAPStatus SegmentReader::_create_reader(size_t* buffer_size) { OLAPStatus SegmentReader::_seek_to_block_directly( int64_t block_id, const std::vector& cids) { - if (!config::block_seek_position && _at_block_start && block_id == _current_block_id) { + if (!_need_to_seek_block && block_id == _current_block_id) { // no need to execute seek return OLAP_SUCCESS; } @@ -861,7 +870,7 @@ OLAPStatus SegmentReader::_seek_to_block_directly( } } _current_block_id = block_id; - _at_block_start = true; + _need_to_seek_block = false; return OLAP_SUCCESS; } @@ -933,7 +942,7 @@ OLAPStatus SegmentReader::_load_to_vectorized_row_batch( if (size == _num_rows_in_block) { _current_block_id++; } else { - _at_block_start = false; + _need_to_seek_block = true; } _stats->blocks_load++; diff --git a/be/src/olap/rowset/segment_reader.h b/be/src/olap/rowset/segment_reader.h index 8bdf961ce59fc1..b52f19aea1d977 100644 --- a/be/src/olap/rowset/segment_reader.h +++ b/be/src/olap/rowset/segment_reader.h @@ -306,9 +306,9 @@ class SegmentReader { bool _eof; // eof标志 - // If this field is false, client must to call seek_to_block before + // If this field is true, client must to call seek_to_block before // calling get_block. - bool _at_block_start = false; + bool _need_to_seek_block = true; int64_t _end_block; // 本次读取的结束块 int64_t _current_block_id = 0; // 当前读取到的块 diff --git a/be/test/olap/delete_handler_test.cpp b/be/test/olap/delete_handler_test.cpp index ef840bd32ccef5..fa062c0cb3fafc 100644 --- a/be/test/olap/delete_handler_test.cpp +++ b/be/test/olap/delete_handler_test.cpp @@ -54,6 +54,9 @@ void set_up() { std::vector paths; paths.emplace_back(config::storage_root_path, -1); + config::min_file_descriptor_number = 65536; + config::max_file_descriptor_number = 131072; + doris::EngineOptions options; options.store_paths = paths; doris::StorageEngine::open(options, &k_engine);