4paradigm / 4paradigm/OpenMLDB
disktable and memtable behave inconsistently with max_traverse_cnt
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 331
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 1
Description
When traversing a table, we use `max_traverse_cnt` to control. If `iterator->GetCount() >= max_traverse_cnt`, the traverse will be stopped. This decision is mainly in tablet_impl.cc but can be done early in disk_table.cc and mem_table.cc. For now, we add more `if (iterator->GetCount() >= max_traverse_cnt)` in disktable, which makes the `max_traverse_cnt` flag works in disktable but not in memtable. In consequence, some tests in table_test related to `max_traverse_cnt` have different results for memtable and disktable
Contributor guide
Research direction
Look at tablet_impl.cc, disk_table.cc, and mem_table.cc for the traversal logic and the check on iterator->GetCount() >= max_traverse_cnt. The inconsistency is that disk_table has this check but mem_table does not. Run the table_test tests related to max_traverse_cnt to see the differing results. The fix is to ensure the same early stop logic is applied in both table implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100