4paradigm / 4paradigm/OpenMLDB
feat: disktable and memtable behave inconsistently when seeking with nonexistent pk
- 主要语言
- C++
- 星标
- 1.7k
- 派生
- 331
- 平均合并
- 12 天 12 小时
- 30 天内合并 PR
- 1
描述
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.
贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- backend, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100