4paradigm / 4paradigm/OpenMLDB
feat: disktable and memtable behave inconsistently when seeking with nonexistent pk
- 主要言語
- C++
- スター
- 1.7k
- フォーク
- 331
- 平均マージ
- 12日 12時間
- マージ済み PR(30日)
- 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