Skip to content

Commit 895950b

Browse files
committed
Prepare every search benchmark replica before querying
Reproduced cold builds on two replicas during the original TermQuery. The comparison host builds with warnings as errors and scoped formatting passes.
1 parent 25e0cf8 commit 895950b

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎benchmarks/KeyLoad.ComparisonHost/Deployment/Connections/KeyLoadDatabase.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ internal KeyLoadDatabase(BenchmarkConnection connection)
3636
/// <summary>The next node's client; calls spread evenly over the cluster.</summary>
3737
internal KeyLoadClient Client => clients[(int)((uint)Interlocked.Increment(ref next) % (uint)clients.Length)];
3838

39+
internal IReadOnlyList<KeyLoadClient> NodeClients => clients;
40+
3941
internal EntityRef Entity(string collection, string id) => new(Partition, collection, id);
4042

4143
/// <summary>Creates a resource in the job's database before any data is written.</summary>

‎benchmarks/KeyLoad.ComparisonHost/Search/Drivers/KeyLoadSearchDriver.cs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ public async Task InsertAsync(IReadOnlyList<SearchDocument> documents, Cancellat
3232
Observe((await database.CommitAsync(mutations, token)).Token);
3333
}
3434

35-
/// <summary>Returns once the lexical index covers every acknowledged insert.</summary>
35+
/// <summary>Waits for the lexical index on each node that will serve measured queries.</summary>
3636
public async Task BuildIndexAsync(CancellationToken token)
3737
{
3838
var minimum = Volatile.Read(ref latest) ?? throw new InvalidOperationException(NothingInserted);
3939
var request = new WaitForIndexRequest(database.Partition, Collection, TextField, minimum);
40-
_ = KeyLoadDatabase.Require(await database.Client.WaitForIndexAsync(request, token), nameof(BuildIndexAsync));
40+
foreach (var client in database.NodeClients)
41+
{
42+
_ = KeyLoadDatabase.Require(await client.WaitForIndexAsync(request, token), nameof(BuildIndexAsync));
43+
}
4144
}
4245

4346
public async Task<IReadOnlyList<string>> SearchAsync(IReadOnlyList<string> terms, int limit, CancellationToken token)

‎docs/Features/BenchmarkComparisons.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ flowchart LR
8585

8686
Each database and node count in this table is one job: 45 jobs. PostgreSQL runs
8787
as one deployment name, `PostgreSQL + pgvector`, for both relational and vector
88-
jobs. A load case counts records (vertices plus edges for the graph); the index
89-
case is one call that makes the loaded search dataset searchable; every other case
90-
counts requests.
88+
jobs. A load case counts records (vertices plus edges for the graph). The index
89+
case counts one operation to make the loaded dataset searchable across the
90+
deployment. KeyLoad waits for its index on every node used by the query driver.
91+
Every other case counts requests.
9192

9293
## Shared modules: change a dataset or scenario once
9394

0 commit comments

Comments
 (0)