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: Avoid acquire index meta's lock for each segment (#31723) #31787

Merged
merged 1 commit into from Apr 2, 2024

Conversation

weiliu1031
Copy link
Contributor

issue: #31662 #31409
pr: #31723

during FilterIndexedSegment in GetRecoveryInfo, it try to acquire index meta's read lock for every segment. when a collection has thousands of segments, which may blocked for more than 10 seconds and even longer. cause AddSegmentIndex may also triggered frequently, which try to get the write lock.

This PR avoid acquire index meta's lock for each segment

issue: milvus-io#31662 milvus-io#31409 

during FilterIndexedSegment in GetRecoveryInfo, it try to acquire index
meta's read lock for every segment. when a collection has thousands of
segments, which may blocked for more than 10 seconds and even longer.
cause `AddSegmentIndex` may also triggered frequently, which try to get
the write lock.

This PR avoid acquire index meta's lock for each segment

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
@sre-ci-robot sre-ci-robot added the size/L Denotes a PR that changes 100-499 lines. label Apr 1, 2024
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Apr 1, 2024
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.51%. Comparing base (4f3bfe2) to head (f4119be).
Report is 6 commits behind head on 2.4.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              2.4   #31787      +/-   ##
==========================================
- Coverage   80.87%   80.51%   -0.37%     
==========================================
  Files         974      974              
  Lines      138841   138826      -15     
==========================================
- Hits       112289   111769     -520     
- Misses      22814    23311     +497     
- Partials     3738     3746       +8     
Files Coverage Δ
internal/datacoord/index_meta.go 97.40% <100.00%> (+0.27%) ⬆️
internal/datacoord/util.go 99.25% <100.00%> (-0.05%) ⬇️

... and 41 files with indirect coverage changes

@mergify mergify bot added the ci-passed label Apr 1, 2024
@xiaocai2333
Copy link
Contributor

/lgtm

@congqixia
Copy link
Contributor

/approve

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia, weiliu1031

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

@sre-ci-robot sre-ci-robot merged commit 5bfe26f into milvus-io:2.4 Apr 2, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug lgtm size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants