Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MB-61029: Deferring the closing of vector index #226

Merged
merged 14 commits into from
Apr 12, 2024
Merged

Conversation

Thejas-bhat
Copy link
Contributor

@Thejas-bhat Thejas-bhat commented Mar 12, 2024

  • Uses the exponentially weighted moving average to get the average hits on a particular field (thereby a particular vector index). The index stays in the memory when the average of the hits is above a certain threshold and below which the index is closed and the memory is freed for reuse on C side of things.
  • This ensures that we are not keeping the index in the memory even when there is no query workload on the field in a segment so the memory pressure does get reduced on the C side of operations.

faiss_vector_cache_noop.go Outdated Show resolved Hide resolved
segment.go Outdated Show resolved Hide resolved
build.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
segment.go Outdated Show resolved Hide resolved
build.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
Copy link
Member

@abhinavdangeti abhinavdangeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Thejas-bhat still quite uneasy with the possibility of race-iness within this code.

faiss_vector_posting.go Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Show resolved Hide resolved
faiss_vector_cache.go Show resolved Hide resolved
@abhinavdangeti
Copy link
Member

@Thejas-bhat I'd appreciate an illustration on how this cache management is being done with ewma tracker - perhaps on the ticket or a document which we can attach to the ticket.

faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_posting.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Outdated Show resolved Hide resolved
faiss_vector_cache.go Show resolved Hide resolved
@abhinavdangeti
Copy link
Member

Looking almost ready @Thejas-bhat 👍🏼

abhinavdangeti
abhinavdangeti previously approved these changes Apr 11, 2024
@abhinavdangeti abhinavdangeti dismissed their stale review April 11, 2024 16:16

On account of an open question.

faiss_vector_cache.go Show resolved Hide resolved
@abhinavdangeti abhinavdangeti merged commit b56abea into master Apr 12, 2024
6 checks passed
abhinavdangeti added a commit to blevesearch/bleve that referenced this pull request Apr 18, 2024
Includes:
* eeb2336 Likith B | MB-61029: Caching Vec To DocID Map (blevesearch/zapx#231)
* b2384fc Rahul Rampure | minor optimizations and bug fixes (blevesearch/zapx#233)
* b56abea Thejas-bhat | MB-61029: Deferring the closing of vector index (blevesearch/zapx#226)
abhinavdangeti added a commit to blevesearch/bleve that referenced this pull request Apr 18, 2024
Includes:
* eeb2336 Likith B | MB-61029: Caching Vec To DocID Map
(blevesearch/zapx#231)
* b2384fc Rahul Rampure | minor optimizations and bug fixes
(blevesearch/zapx#233)
* b56abea Thejas-bhat | MB-61029: Deferring the closing of vector index
(blevesearch/zapx#226)
@abhinavdangeti abhinavdangeti deleted the delayedClosing branch May 21, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants