Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
15 changes: 12 additions & 3 deletions be/src/olap/rowset/segment_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<uint32_t>& 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;
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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++;
Expand Down
4 changes: 2 additions & 2 deletions be/src/olap/rowset/segment_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; // 当前读取到的块
Expand Down
3 changes: 3 additions & 0 deletions be/test/olap/delete_handler_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ void set_up() {
std::vector<StorePath> 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);
Expand Down