ethbak commented on code in PR #16627:
URL: https://github.com/apache/lucene/pull/16627#discussion_r4160689361


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswConcurrentMergeBuilder.java:
##########
@@ -90,6 +113,23 @@ public OnHeapHnswGraph build(int maxOrd) throws IOException 
{
       worker.setMergeStartTimeNs(mergeStartTimeNs);
       worker.setCumulativeWorkTimeNs(cumulativeWorkTimeNs);
     }
+    if (prunedGraph != null) {
+      long repairStartNs = System.nanoTime();
+      repairDisconnectedNodes();
+      long rebalanceStartNs = System.nanoTime();
+      prunedGraph.builder().rebalanceGraph();

Review Comment:
   I considered it but its time is already minimal (I measured  27–71 ms vs 
1.2–17 s for repair) and structurally it's also a bit more complex because 
rebalance decides its work as it goes. I think you'd need either to pre-draw 
the promotions (changing the semantics) or a graph-wide lock around addNode.



-- 
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]

Reply via email to