Skip to content

Test and fixes for concurrent updates to vectors - #2032

Draft
kevin-montrose wants to merge 19 commits into
mainfrom
users/kmontrose/VADDUpdates
Draft

Test and fixes for concurrent updates to vectors#2032
kevin-montrose wants to merge 19 commits into
mainfrom
users/kmontrose/VADDUpdates

Conversation

@kevin-montrose

@kevin-montrose kevin-montrose commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Tests:

  • VADD updates to elements already in a Vector Set
  • Replication of concurrent VADD updates
  • Replication of concurrent VREM and VADD
  • Replication of concurrent VSETATTR updates

Fixes:

  • Ordering of VADDs during replication replay

This introduces a separate set of element-level locks to guarantee order in AOF matches order actually applied to log. It also splits VADD replays into multiple channels (in addition to the existing multiple tasks) to guarantee element updates on replicas are applied in AOF order.

TODO:

  • VADD returns 1 on updates, needs to return 0; this requires a fix on the DiskANN side
  • Perf comparison tests for VADD to measure impact of new locks
  • Update vector-set.md

New locking introduces basically no overhead when not contended.

Benchmark is 50 serial VADDs of 128-dimension vectors.

BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.8893/25H2/2025Update/HudsonValley2)
Intel Xeon W-2235 CPU 3.80GHz (Max: 3.79GHz), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.302
[Host] : .NET 8.0.29 (8.0.29, 8.0.2926.32403), X64 RyuJIT x86-64-v4
.NET 10 : .NET 10.0.10 (10.0.10, 10.0.1026.32716), X64 RyuJIT x86-64-v4
.NET 8 : .NET 8.0.29 (8.0.29, 8.0.2926.32403), X64 RyuJIT x86-64-v4

EnvironmentVariables=DOTNET_TieredPGO=0 Concurrent=False Server=False
InvocationCount=1 UnrollFactor=1

Before change (34d14a8)

Method Job Runtime Params Mean Error StdDev
VADD .NET 10 .NET 10.0 AAD 1.125 s 0.0215 s 0.0239 s
VADD .NET 8 .NET 8.0 AAD 1.174 s 0.0232 s 0.0293 s
VADD .NET 10 .NET 10.0 ACL 1.094 s 0.0186 s 0.0146 s
VADD .NET 8 .NET 8.0 ACL 1.161 s 0.0199 s 0.0177 s
VADD .NET 10 .NET 10.0 AOF 1.102 s 0.0188 s 0.0166 s
VADD .NET 8 .NET 8.0 AOF 1.112 s 0.0080 s 0.0071 s
VADD .NET 10 .NET 10.0 None 1.073 s 0.0146 s 0.0130 s
VADD .NET 8 .NET 8.0 None 1.124 s 0.0139 s 0.0123 s

After change (5ce41a7)

Method Job Runtime Params Mean Error StdDev
VADD .NET 10 .NET 10.0 AAD 1.067 s 0.0147 s 0.0123 s
VADD .NET 8 .NET 8.0 AAD 1.108 s 0.0111 s 0.0103 s
VADD .NET 10 .NET 10.0 ACL 1.051 s 0.0167 s 0.0156 s
VADD .NET 8 .NET 8.0 ACL 1.115 s 0.0161 s 0.0151 s
VADD .NET 10 .NET 10.0 AOF 1.041 s 0.0104 s 0.0087 s
VADD .NET 8 .NET 8.0 AOF 1.111 s 0.0159 s 0.0133 s
VADD .NET 10 .NET 10.0 None 1.051 s 0.0181 s 0.0141 s
VADD .NET 8 .NET 8.0 None 1.111 s 0.0124 s 0.0110 s

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