Skip to content

[V1] Fix Vector Set Creation Live Lock#1852

Merged
kevin-montrose merged 5 commits into
release/v1from
users/kmontrose/vectorSetLiveLock-v1
Jun 3, 2026
Merged

[V1] Fix Vector Set Creation Live Lock#1852
kevin-montrose merged 5 commits into
release/v1from
users/kmontrose/vectorSetLiveLock-v1

Conversation

@kevin-montrose
Copy link
Copy Markdown
Contributor

Cherry-picking #1846 onto v1 to keep Vector Set parity.

We're getting pretty close to stopping backports to V1, but since #1726 will land against v1 I'd like to keep parity for a bit longer.

…r vector set creation to live lock; this fixes that by, should initial creation be necessary, switching to an exclusive acquisition iff the 'cheap' promotion fails
…adOptimizedLock; cleanup VectorSet locking as part of adopting type
Copilot AI review requested due to automatic review settings June 3, 2026 15:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cherry-picks the Vector Set lock acquisition changes from #1846 onto the v1 branch to eliminate a contention-induced live lock during Vector Set index (re)creation by adjusting the shared→exclusive promotion strategy.

Changes:

  • Adds a typed ReadOptimizedLock.LockToken and a unified ReleaseLock(...) API (replacing separate shared/exclusive release methods).
  • Updates Vector Set locking to fall back to acquiring an initial exclusive lock after a failed promotion attempt, avoiding repeated promotion failures under contention.
  • Updates ReadOptimizedLock tests to use the new token/release APIs and ref-based promotion.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
test/Garnet.test/ReadOptimizedLockTests.cs Updates tests to use LockToken, ReleaseLock, and ref-based promotion.
libs/server/Resp/Vector/VectorManager.Locking.cs Implements the livelock fix by switching to initial exclusive acquisition after failed promote; consolidates lock scope types.
libs/common/ReadOptimizedLock.cs Introduces LockToken, unifies release logic, and updates acquire/promote APIs accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/common/ReadOptimizedLock.cs
Comment thread libs/common/ReadOptimizedLock.cs
Comment thread libs/server/Resp/Vector/VectorManager.Locking.cs
Comment thread libs/server/Resp/Vector/VectorManager.Locking.cs
@kevin-montrose kevin-montrose merged commit cd3a0ac into release/v1 Jun 3, 2026
49 of 50 checks passed
@kevin-montrose kevin-montrose deleted the users/kmontrose/vectorSetLiveLock-v1 branch June 3, 2026 16:46
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