4paradigm / 4paradigm/OpenMLDB
feat: disktable and memtable behave inconsistently when seeking with nonexistent pk
- Ngôn ngữ chính
- C++
- Star
- 1.7k
- Fork
- 331
- Merge trung bình
- 12 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Using the XxxTableTraverseIterator::Seek(const std::string& pk, uint64_t time) will get the next record after this (pk, time). In Memtable, it'll always get the next record. But in Disktable, if disktable does not contain a record with this pk, it will result in a not valid iterator.
**Additional context**
``` cpp
cfo.prefix_extractor.reset(new KeyTsPrefixTransform());
```
Here this extractor is used to get the pk from combineKey(pk, time). RocksDB will use this prefix to improve the searching speed. And using this extractor will cause seek to return not valid if pk is not found.
Hướng dẫn đóng góp
Hướng nghiên cứu
Look at the XxxTableTraverseIterator::Seek implementation in both Memtable and Disktable. The issue mentions a KeyTsPrefixTransform used with RocksDB. Examine how the prefix extractor affects seek behavior when a primary key is not found. Run existing tests for table iteration to see the inconsistency, and ensure both table types return a valid iterator pointing to the next record.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- backend, databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100