Skip to content

[BUG] Percolator commit accepts commitVersion earlier than startVersionΒ #41

@feichai0017

Description

@feichai0017

πŸ› Bug Description

percolator.Commit currently accepts commitVersion < startVersion and persists it.
This violates MVCC ordering and allows values to become visible before the transaction start timestamp.

Code path:

  • percolator/txn.go:88
  • percolator/txn.go:279
  • percolator/txn.go:299

πŸ›  Reproduction Steps

  1. Prewrite key k with startVersion=20.
  2. Commit with commitVersion=10.
  3. Read key at readTs=15.

πŸ“‹ Expected Behavior

Commit should reject requests where commitVersion < startVersion.
Read at ts=15 must not observe data from transaction startTs=20.

πŸ“Έ Screenshots / Logs

Observed output:

  • commit keyError: <nil>
  • write found, commitTs=10, startTs=20
  • read@15 value="v" err=<nil>

πŸ’» Environment

  • OS: macOS 26.2 (arm64)
  • Go Version: go1.24.4
  • NoKV Version: current main (local HEAD on 2026-02-11)

🧐 Additional Context

This issue can break snapshot visibility guarantees for distributed transactions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus/reproducedBug has been reproduced

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions