mvcc

📁 jamals86/kalamdb 📅 6 days ago
9
总安装量
8
周安装量
#31224
全站排名
安装命令
npx skills add https://github.com/jamals86/kalamdb --skill mvcc

Agent 安装分布

opencode 8
gemini-cli 8
claude-code 8
github-copilot 8
codex 8
kimi-cli 8

Skill 文档

Use this skill when implementing or modifying MVCC logic, including version metadata, visibility filtering, and cleanup.

Core principles:

  • Reads see a consistent snapshot; writes create new versions.
  • Version chains must be ordered and efficiently prunable.
  • Visibility is determined by transaction timestamp/epoch and commit status.

Implementation guidance:

  1. Locate the existing MVCC abstractions (e.g., version metadata types, visibility filters) before adding new logic.
  2. Ensure reads filter out uncommitted or aborted versions and respect snapshot boundaries.
  3. When inserting updates, create new version entries rather than in-place mutation.
  4. For deletes, add tombstones and make them visible using the same MVCC rules.
  5. Compaction/cleanup must only remove versions that are not visible to any active snapshot.
  6. Keep metadata lightweight and store large payloads separately if needed.

Common pitfalls:

  • Returning uncommitted data to readers.
  • Deleting versions still visible to long-running snapshots.
  • Mixing wall-clock time with logical timestamps; use the project’s canonical time/epoch source.

When adding new APIs:

  • Prefer typed identifiers and enums.
  • Keep MVCC filtering in the query path, not at the storage engine boundary unless it is explicitly part of the storage abstraction.