do not use "double buffered" commit logger
@@ -35,7 +35,7 @@ type neighborFinderConnector struct {
targetLevel int
currentMaxLevel int
denyList helpers.AllowList
- bufLinksLog BufferedLinksLogger
+ // bufLinksLog BufferedLinksLogger
}
func newNeighborFinderConnector(graph *hnsw, node *vertex, entryPointID uint64,
@@ -53,8 +53,6 @@ func newNeighborFinderConnector(graph *hnsw, node *vertex, entryPointID uint64,
}
func (n *neighborFinderConnector) Do() error {
- n.bufLinksLog = n.graph.commitLog.NewBufferedLinksLogger()
-
dist, ok, err := n.graph.distBetweenNodeAndVec(n.entryPointID, n.nodeVec)
if err != nil {
return errors.Wrapf(err, "calculate distance between insert node and final entrypoint")
@@ -73,7 +71,7 @@ func (n *neighborFinderConnector) Do() error {
}
}
- return n.bufLinksLog.Close()
+ return nil
}
func (n *neighborFinderConnector) doAtLevel(level int) error {
@@ -106,7 +104,7 @@ func (n *neighborFinderConnector) doAtLevel(level int) error {
// set all outoing in one go
n.node.setConnectionsAtLevel(level, neighbors)
- n.bufLinksLog.ReplaceLinksAtLevel(n.node.id, level, neighbors)
+ n.graph.commitLog.ReplaceLinksAtLevel(n.node.id, level, neighbors)
for _, neighborID := range neighbors {
if err := n.connectNeighborAtLevel(neighborID, level); err != nil {
@@ -217,7 +215,7 @@ func (n *neighborFinderConnector) connectNeighborAtLevel(neighborID uint64,
}
}
- if err := n.bufLinksLog.ReplaceLinksAtLevel(neighbor.id, level,
+ if err := n.graph.commitLog.ReplaceLinksAtLevel(neighbor.id, level,
updatedConnections); err != nil {
return err
}
