luoyuxia opened a new pull request, #3330:
URL: https://github.com/apache/fluss/pull/3330
## Summary
- **KvRecoverHelper**: Add composite key encoding (partition name + raw key)
during WAL replay for `__historical__` partitions, matching the key format used
by `KvTablet.processKvRecords()`.
- **Replica.initKvTablet**: Skip snapshot for historical partitions — create
fresh RocksDB and replay WAL from tiered offset (`lakeLogEndOffset`).
- **Replica.createKv**: Skip periodic snapshot scheduling for historical
partitions since their RocksDB is non-persistent.
- **ReplicaManager.makeLeaders**: Move `updateWithLakeTableSnapshot` before
`makeLeader` so that `initKvTablet` reads the up-to-date `lakeLogEndOffset`
from ZK before recovery, avoiding excessive WAL replay on follower-to-leader
transitions.
## Test plan
- [x] `KvRecoverHelperTest` — unit tests for composite key WAL replay,
tiered offset recovery, and partition column resolution
- [x] `KvHistoricalPartitionReplicaRestoreITCase` — integration tests:
- Phase 1: Write records for two partitions ("2000", "2001"), failover,
verify full WAL replay with correct composite key encoding
- Phase 2: Simulate tiering via ZK `LakeTableSnapshot`, write more
records, failover, verify only post-tiered records recovered (pre-tiered
records skipped)
- Verified: test fails without the `ReplicaManager` fix (follower reads
stale offset), passes with the fix
- [x] `KvReplicaRestoreITCase` — verified no regression in existing restore
tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]