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

sparse float vector index to support mmap when loading from index file #530

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

zhengbuqian
Copy link
Collaborator

issue: milvus-io/milvus#29419

/kind: improvement

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zhengbuqian

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.69%. Comparing base (3c46f4c) to head (8f6c703).
Report is 24 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main     #530       +/-   ##
=========================================
+ Coverage      0   71.69%   +71.69%     
=========================================
  Files         0       67       +67     
  Lines         0     4431     +4431     
=========================================
+ Hits          0     3177     +3177     
- Misses        0     1254     +1254     

see 67 files with indirect coverage changes

#endif
}
map_ = static_cast<char*>(mmap(nullptr, map_size_, PROT_READ, map_flags, reader.descriptor(), 0));
madvise(map_, map_size_, MADV_RANDOM);
Copy link
Collaborator

Choose a reason for hiding this comment

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

please check the results of mmap and madvise whether any of these two fails

if (map_ != nullptr) {
auto res = munmap(map_, map_size_);
if (res != 0) {
throw std::runtime_error("failed to munmap when trying to delete index: " +
Copy link
Collaborator

Choose a reason for hiding this comment

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

this may cause an exception to be thrown inside ~SparseInvertedIndexNode()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in the current impl seems the only thing we can do is to swallow the error? we provide no method for the users to explicitly destroy all the resources used so we can only clean in the destructor

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
@alexanderguzhva
Copy link
Collaborator

/lgtm

@sre-ci-robot sre-ci-robot merged commit 2ab12eb into zilliztech:main Apr 26, 2024
11 checks passed
@zhengbuqian zhengbuqian deleted the sparse-index-mmap branch April 28, 2024 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants