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

fix(core): Fix tantivy column cache not releasing memory from deleted segments #1864

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

rfairfax
Copy link
Contributor

@rfairfax rfairfax commented Oct 4, 2024

Columns in the column cache hold a reference to the mmaped file data that backs the segment. These segments can be deleted during segment merging, but if a column for that segment is in the cache it prevents the mmap from closing and releasing RAM.

To fix this we subscribe for notifications on segment list changes and clear the column cache when these occur so stale segments can be reclaimed.

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?

Current behavior :

Old segments can remain in memory via column cache

New behavior :

Column cache is reset on segment list changes

… segments

Columns in the column cache hold a reference to the mmaped file data that backs
the segment.  These segments can be deleted during segment merging, but if a column
for that segment is in the cache it prevents the mmap from closing and releasing RAM.

To fix this we subscribe for notifications on segment list changes and clear the
column cache when these occur so stale segments can be reclaimed.
@rfairfax rfairfax merged commit ebee7ae into filodb:develop Oct 7, 2024
1 check passed
@rfairfax rfairfax deleted the rfairfax/tantivy_mmap branch October 7, 2024 15:58
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.

2 participants