[Feature] Maintain source-backed primary-key BTree indexes during compaction
- 主要言語
- C++
- スター
- 65
- フォーク
- 25
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 80
説明
### Search before asking
- [x] I searched in the issues and found nothing similar.
### Motivation
#192 and #194 added the source-backed primary-key BTree read path. Paimon C++ writers still need the corresponding maintenance path: after compaction changes the active source files of a data level, a missing or stale payload leaves that level uncovered and queries fall back to normal file scans.
Paimon C++ should maintain these payloads during fixed-bucket primary-key writes and compaction, using the existing Java-compatible source metadata, BTree payload format, and index manifests.
### Solution
Add the source-backed primary-key BTree maintenance lifecycle for fixed-bucket primary-key tables:
1. Validate the Java-equivalent table and index prerequisites.
2. Restore committed source-backed payload metadata into bucket writers without mixing Data Evolution payloads.
3. Build one payload per indexed field and positive data level from physical source rows, then commit matching index additions and deletions in the same snapshot as the data changes.
4. Reconcile missing, stale, duplicate, replaced, removed-definition, and empty-level payloads during compaction.
5. Isolate build failures to the affected field and level so reads safely fall back to normal scans and a later maintenance attempt can rebuild the payload.
6. Retain live index files during snapshot expiration and orphan cleanup, including tag and branch safety and external-file deletion retries.
Reuse the existing storage formats and internal reader, writer, sort-buffer, path, manifest, and commit abstractions. Do not introduce a new index family or storage protocol.
The implementation is in #245. It keeps maintenance synchronous; Java asynchronous scheduling, manual rebuild actions, realtime writers, and postpone-bucket writers remain outside this scope.
### Anything else?
This is a maintenance-path follow-up to the read-path work in #192 and #194. It ports an existing Java capability, so no separate PIP is proposed.
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
コントリビューションガイド
調査の方向性
まず、#245 で参照されている実装と、#192 および #194 のソースに基づく primary-key read path を読みます。既存のストレージ形式と、内部の reader と writer、manifest、path、sort-buffer、commit の各抽象化を追跡します。fixed-bucket writes と compaction がフィールド単位および正のレベルの payloads を維持し、cleanup と failed builds が安全な scan fallback を保持すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- databases
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100