milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
27.29k stars 2.63k forks source link

enhance: Reduce unnecessary goroutines during search #32703

Open bigsheeper opened 3 weeks ago

bigsheeper commented 3 weeks ago

Since SQ thread pool is present in cgo.Search, allocating goroutines at the segments level for concurrency is unnecessary. Simply use the thread pool directly at the segments level to avoid extra goroutines.

issue: https://github.com/milvus-io/milvus/issues/27456

sre-ci-robot commented 3 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bigsheeper To complete the pull request process, please assign czs007 after the PR has been reviewed. You can assign the PR to them by writing /assign @czs007 in a comment when ready.

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

Needs approval from an approver in each of these files: - **[internal/querynodev2/segments/OWNERS](https://github.com/milvus-io/milvus/blob/master/internal/querynodev2/segments/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
mergify[bot] commented 3 weeks ago

@bigsheeper ut workflow job failed, comment rerun ut can trigger the job again.

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 85.96491% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 81.74%. Comparing base (83ce352) to head (ecf5b75). Report is 12 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/milvus-io/milvus/pull/32703/graphs/tree.svg?width=650&height=150&src=pr&token=XdCbzGJk2E&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)](https://app.codecov.io/gh/milvus-io/milvus/pull/32703?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) ```diff @@ Coverage Diff @@ ## master #32703 +/- ## ========================================== - Coverage 81.77% 81.74% -0.03% ========================================== Files 1001 1002 +1 Lines 125359 125435 +76 ========================================== + Hits 102517 102542 +25 - Misses 18956 18997 +41 - Partials 3886 3896 +10 ``` | [Files](https://app.codecov.io/gh/milvus-io/milvus/pull/32703?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io) | Coverage Δ | | |---|---|---| | [internal/querynodev2/segments/segment.go](https://app.codecov.io/gh/milvus-io/milvus/pull/32703?src=pr&el=tree&filepath=internal%2Fquerynodev2%2Fsegments%2Fsegment.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-aW50ZXJuYWwvcXVlcnlub2RldjIvc2VnbWVudHMvc2VnbWVudC5nbw==) | `66.87% <100.00%> (-0.21%)` | :arrow_down: | | [internal/querynodev2/segments/search.go](https://app.codecov.io/gh/milvus-io/milvus/pull/32703?src=pr&el=tree&filepath=internal%2Fquerynodev2%2Fsegments%2Fsearch.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-aW50ZXJuYWwvcXVlcnlub2RldjIvc2VnbWVudHMvc2VhcmNoLmdv) | `63.63% <76.92%> (+0.96%)` | :arrow_up: | | [internal/querynodev2/segments/retrieve.go](https://app.codecov.io/gh/milvus-io/milvus/pull/32703?src=pr&el=tree&filepath=internal%2Fquerynodev2%2Fsegments%2Fretrieve.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io#diff-aW50ZXJuYWwvcXVlcnlub2RldjIvc2VnbWVudHMvcmV0cmlldmUuZ28=) | `79.66% <76.19%> (+0.66%)` | :arrow_up: | ... and [34 files with indirect coverage changes](https://app.codecov.io/gh/milvus-io/milvus/pull/32703/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=milvus-io)
mergify[bot] commented 2 weeks ago

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

mergify[bot] commented 2 weeks ago

@bigsheeper ut workflow job failed, comment rerun ut can trigger the job again.