Skip to content

[fix][store] Fix raft snapshot over-read caused by unused iterator upper bound - #1486

Merged
yuhaijun999 merged 9 commits into
dingodb:quickBI-v4.0.0from
yuhaijun999:quickBI-v4.0.0
Sep 11, 2026
Merged

yuhaijun999 merged 9 commits into
dingodb:quickBI-v4.0.0from
yuhaijun999:quickBI-v4.0.0

Conversation

@yuhaijun999

Copy link
Copy Markdown
Collaborator

[fix][store] Fix raft snapshot over-read caused by unused iterator upper bound

visualYJD and others added 9 commits September 10, 2026 17:56
…per bound

OpenReaderAdaptor and ContextReset built iter_options with the region's
encoded range but passed a default-constructed IteratorOptions() to
NewIterator, so no iterate_upper_bound was ever set; the read loop also
never checked the upper bound. As a result an InstallSnapshot streamed
every key >= the region's start_key to the end of the CF, sending other
regions' data to the follower (region_size 0.2GB -> 426GB snapshots in
production; new replicas polluted with cross-region keys).

Pass the prepared iter_options at both call sites and add an explicit
upper-bound guard (empty-safe) in the read loop.

Verified on a 5-store local cluster:
- head-of-CF region 80001: 24,754,030 B / 938 keys -> 1,061,991 B / 237
  keys (23.3x), sst_dump shows 0 cross-region keys (was 320)
- mid-chain region 80002: 20,991,640 B, own data only (was own+2.6MB)
- CF-tail region 80005: 1,977,970 B, byte-identical before/after
  (no self-truncation)
@yuhaijun999
yuhaijun999 merged commit 1804818 into dingodb:quickBI-v4.0.0 Sep 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants