-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
bugSomething isn't workingSomething isn't workingstatus/reproducedBug has been reproducedBug has been reproduced
Description
π Bug Description
DB.NewIterator is documented as default CF user-key iterator, but currently surfaces internal semantics:
- returns entries from non-default CFs (lock/write)
- returns multiple MVCC versions for same user key
Code path:
iterator.go:69(contract comment)iterator.go:193-227(materialization without CF/version filtering)- internal dependency in
raftstore/kv/apply.go:122-146
π Reproduction Steps
- Write one key in
CFDefault, one inCFLock, one inCFWrite. - Iterate with
db.NewIterator(&utils.Options{IsAsc:true}). - Observe all CFs are returned.
- Write two versions for same user key and iterate again.
- Observe both versions are returned.
π Expected Behavior
Public iterator contract should be explicit and consistent:
- either expose only default CF latest visible key
- or be renamed/documented as internal iterator API
πΈ Screenshots / Logs
Observed output in repro:
cf=default key=k1cf=lock key=k2cf=write key=k3key=k ver=2 val=v2key=k ver=1 val=v1
π» Environment
- OS: macOS 26.2 (arm64)
- Go Version: go1.24.4
- NoKV Version: current main (local HEAD on 2026-02-11)
π§ Additional Context
Current implementation creates abstraction leakage: internal raft scan relies on this behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstatus/reproducedBug has been reproducedBug has been reproduced