Skip to content

Support per-key locking for concurrent write serialization - #3

Merged
ekkolon merged 1 commit into
mainfrom
feat-perkey-locking
Feb 27, 2026
Merged

Support per-key locking for concurrent write serialization#3
ekkolon merged 1 commit into
mainfrom
feat-perkey-locking

Conversation

@ekkolon

@ekkolon ekkolon commented Feb 27, 2026

Copy link
Copy Markdown
Owner

📑 Description

Introduce KeyLock, a per-key locking mechanism for minikv that enables exclusive access to individual keys. Locks are acquired via try_lock, which returns a KeyGuard that automatically releases the lock when dropped. This design ensures safe, deterministic serialization of writes to the same key while allowing other keys to be accessed concurrently. The implementation uses DashMap for thread-safe, atomic entry operations, preventing race conditions and TOCTOU issues.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@ekkolon
ekkolon merged commit 09cc44e into main Feb 27, 2026
6 checks passed
@ekkolon
ekkolon deleted the feat-perkey-locking branch February 27, 2026 13:33
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.

1 participant