microsoft / DiskANN

Graph-structured Indices for Scalable, Fast, Fresh and Filtered Approximate Nearest Neighbor Search
Other
1.02k stars 208 forks source link

Fix disk index search deadlock when using 1 thread #556

Open sunpenghao opened 3 months ago

sunpenghao commented 3 months ago

Reference Issues/PRs

Fixes #462

What does this implement/fix? Briefly explain your changes.

Several steps during disk index search initialization read graph nodes into memory by "borrowing" search thread data to issue async IOs, and #417 wrapped this process into read_nodes. However, the original call sites are not cleaned so the thread data are borrowed repetitively. With -T 1, there is only one thread data item, and initialization will therefore deadlock on waiting for available thread data.

Fix this by removing unneeded thread data borrowing.

Any other comments?

N/A