Skip to content

Fixes for Vector Set RENAMEs in AOF replay - #2080

Merged
kevin-montrose merged 14 commits into
mainfrom
users/kmontrose/vectorSetRenameAOFFixes
Aug 20, 2026
Merged

Fixes for Vector Set RENAMEs in AOF replay#2080
kevin-montrose merged 14 commits into
mainfrom
users/kmontrose/vectorSetRenameAOFFixes

Conversation

@kevin-montrose

Copy link
Copy Markdown
Contributor

A number of issues exist if Vector Sets are RENAME'd during AOF replay.

Fundamentally RENAME is a little weird as it is not a single operation against the Tsavorite log, but rather a bundle of gets, deletes, and sets covered by a transaction. Related fix #2071 .

This PR fixes these by:

  • Correctly handling the SetFlags version of VADD
  • Waiting for concurrent VADDs and various cleanup tasks to complete before and after AOF recovery starts
  • Special casing RENAME's associated UnifiedStoreStringUpsert op in the AOF
    • This is necessary because the context and indexPtr actually stored in the value are not necessarily correct during replay and need to be refreshed with current values

Copilot AI balanced review requested due to automatic review settings August 19, 2026 14:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Vector Set rename handling during AOF recovery and coordinates background vector operations around replay.

Changes:

  • Records rename metadata and reconstructs Vector Set indexes during replay.
  • Adds recovery quiescence waits and Vector Set reconciliation.
  • Adds AOF rename recovery tests.

Reviewed changes

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

Show a summary per file
File Description
test/standalone/Garnet.test.vectorset/VectorSetOverwriteTests.cs Uses the expanded quiescence wait.
test/standalone/Garnet.test.vectorset/RespVectorSetTests.cs Tests rename recovery scenarios.
libs/storage/Tsavorite/cs/src/core/ClientSession/ManageClientSessions.cs Removes blank lines.
libs/server/StoreWrapper.cs Reorders vector recovery around AOF replay.
libs/server/Storage/Session/UnifiedStore/UnifiedStoreOps.cs Records rename keys and record type.
libs/server/Storage/Functions/UnifiedStore/VarLenInputMethods.cs Restores record type during replay.
libs/server/Storage/Functions/UnifiedStore/UpsertMethods.cs Separates rename metadata from expiration.
libs/server/Resp/Vector/VectorManager.Replication.cs Handles flag replay and rename copying.
libs/server/Resp/Vector/VectorManager.cs Formatting-only change.
libs/server/Resp/Vector/VectorManager.Cleanup.cs Expands background-work waiting.
libs/server/Databases/SingleDatabaseManager.cs Waits for vector replay and cleanup.
libs/server/Databases/MultiDatabaseManager.cs Adds per-database vector quiescence.
libs/server/Databases/IDatabaseManager.cs Updates recovery-order documentation.
libs/server/AOF/AofProcessor.cs Special-cases Vector Set rename upserts.
libs/cluster/Server/Replication/ReplicationManager.cs Reconciles vectors before cluster AOF replay.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libs/server/Storage/Session/UnifiedStore/UnifiedStoreOps.cs
Comment thread libs/server/Resp/Vector/VectorManager.Cleanup.cs Outdated
Comment thread libs/server/AOF/AofProcessor.cs Outdated
Comment thread libs/server/AOF/AofProcessor.cs Outdated
@kevin-montrose
kevin-montrose merged commit 57c5215 into main Aug 20, 2026
227 checks passed
@kevin-montrose
kevin-montrose deleted the users/kmontrose/vectorSetRenameAOFFixes branch August 20, 2026 21:12
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