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

enhance: Remove mutex from SegmentManger in querynode #39051

Merged

Conversation

bigsheeper
Copy link
Contributor

Remove mutex from SegmentManger in querynode to prevent mutex contention.

issue: #37630

@sre-ci-robot sre-ci-robot added the size/L Denotes a PR that changes 100-499 lines. label Jan 7, 2025
@mergify mergify bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Jan 7, 2025
Copy link
Contributor

mergify bot commented Jan 7, 2025

@bigsheeper E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 95.74468% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.14%. Comparing base (fd84ed8) to head (cfd0a1a).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
internal/querynodev2/segments/manager.go 95.74% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #39051       +/-   ##
===========================================
+ Coverage   69.71%   81.14%   +11.43%     
===========================================
  Files         299     1404     +1105     
  Lines       26768   197678   +170910     
===========================================
+ Hits        18661   160408   +141747     
- Misses       8107    31638    +23531     
- Partials        0     5632     +5632     
Components Coverage Δ
Client 79.53% <ø> (∅)
Core 69.71% <ø> (ø)
Go 83.07% <95.74%> (∅)
Files with missing lines Coverage Δ
internal/querynodev2/segments/manager.go 75.27% <95.74%> (ø)

... and 1104 files with indirect coverage changes

Copy link
Contributor

mergify bot commented Jan 8, 2025

@bigsheeper E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link
Contributor

mergify bot commented Jan 8, 2025

@bigsheeper go-sdk check failed, comment rerun go-sdk can trigger the job again.

Copy link
Contributor

mergify bot commented Jan 9, 2025

@bigsheeper E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

@mergify mergify bot added the ci-passed label Jan 14, 2025
@@ -313,58 +315,57 @@ func (segments segments) RangeWithFilter(criterion *segmentCriterion, process fu
return
}

var candidates []map[int64]Segment
var candidates []*typeutil.ConcurrentMap[typeutil.UniqueID, Segment]
Copy link
Member

Choose a reason for hiding this comment

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

Why we need concurrentMap here since its scope is just this function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since candidates are directly constructed from growingSegments and sealedSegments, which are of the ConcurrentMap type, using a regular map for candidates would require a copy operation, making it inefficient.

Copy link
Member

Choose a reason for hiding this comment

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

Actually it is shallow copy so not that heavy. But I don't think it is something have to be done.

Copy link
Member

@liliu-z liliu-z left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bigsheeper, liliu-z

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 f5234c3 into milvus-io:master Jan 15, 2025
20 checks passed
bigsheeper added a commit to bigsheeper/milvus that referenced this pull request Jan 15, 2025
Remove mutex from SegmentManger in querynode to prevent mutex
contention.

issue: milvus-io#37630

---------

Signed-off-by: bigsheeper <[email protected]>
sre-ci-robot pushed a commit that referenced this pull request Jan 16, 2025
…39282)

Remove mutex from SegmentManger in querynode to prevent mutex
contention.

issue: #37630

pr: #39051

Signed-off-by: bigsheeper <[email protected]>
gifi-siby pushed a commit to gifi-siby/milvus that referenced this pull request Jan 16, 2025
Remove mutex from SegmentManger in querynode to prevent mutex
contention.

issue: milvus-io#37630

---------

Signed-off-by: bigsheeper <[email protected]>
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/enhancement Issues or changes related to enhancement lgtm size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants