ethbak commented on code in PR #16627:
URL: https://github.com/apache/lucene/pull/16627#discussion_r3971314322
##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java:
##########
@@ -419,8 +419,21 @@ void addDiverseNeighbors(
*/
NeighborArray neighbors = hnsw.getNeighbors(level, node);
int maxConnOnLevel = level == 0 ? M * 2 : M;
- boolean[] mask =
- selectAndLinkDiverse(node, neighbors, candidates, maxConnOnLevel,
scorer, isLinkRepair);
+ boolean[] mask;
+ if (isLinkRepair && hnswLock != null) {
Review Comment:
I removed the comment you mentioned. As for the null check, I kept that
because it can still be null for link repair. `InitializedHnswGraphBuilder`
uses the shared repair and rebalance helpers on the serial path without the
lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]