Skip to content

fix: skip dim check for non-vector fields in PreCheck (#41287) #41289

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

Merged

Conversation

Hoyaspark
Copy link
Contributor

What this PR does

This PR fixes an issue where the PreCheck function in DataCoord logs unnecessary warnings
when attempting to retrieve 'dim' from non-vector fields.

The change adds a check to only call GetDimFromParams when the field type is a vector type.

Related issue

Fixes #41287

@sre-ci-robot sre-ci-robot requested review from congqixia and sunby April 14, 2025 16:54
@sre-ci-robot
Copy link
Contributor

Welcome @Hoyaspark! It looks like this is your first PR to milvus-io/milvus 🎉

@sre-ci-robot sre-ci-robot added the size/S Denotes a PR that changes 10-29 lines. label Apr 14, 2025
Copy link
Contributor

mergify bot commented Apr 14, 2025

@Hoyaspark Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco.

@mergify mergify bot added needs-dco DCO is missing in this pull request. kind/bug Issues or changes related a bug labels Apr 14, 2025
@Hoyaspark Hoyaspark force-pushed the fix/41287-skip-dim-check-non-vector branch from 1661385 to f86c099 Compare April 14, 2025 16:55
@mergify mergify bot added dco-passed DCO check passed. and removed needs-dco DCO is missing in this pull request. labels Apr 14, 2025
Copy link
Contributor

mergify bot commented Apr 14, 2025

@Hoyaspark cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.

Signed-off-by: 박상호 <[email protected]>
Signed-off-by: Sangho Park <[email protected]>
Copy link
Contributor

mergify bot commented Apr 14, 2025

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

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.61%. Comparing base (afb1b85) to head (a5417fb).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
internal/datacoord/task_index.go 50.00% 2 Missing and 2 partials ⚠️

❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #41289       +/-   ##
===========================================
+ Coverage   72.32%   80.61%    +8.28%     
===========================================
  Files         310     1476     +1166     
  Lines       28670   210123   +181453     
===========================================
+ Hits        20736   169391   +148655     
- Misses       7934    34602    +26668     
- Partials        0     6130     +6130     
Components Coverage Δ
Client 79.59% <ø> (∅)
Core 72.61% <ø> (+0.28%) ⬆️
Go 82.01% <50.00%> (∅)
Files with missing lines Coverage Δ
internal/datacoord/task_index.go 80.00% <50.00%> (ø)

... and 1192 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@xiaocai2333 xiaocai2333 left a comment

Choose a reason for hiding this comment

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

LGTM

// don't return, maybe field is scalar field or sparseFloatVector
// Extract dim only for vector types to avoid unnecessary warnings
dim := -1
if typeutil.IsVectorType(field.GetDataType()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

SparseFloatVector doesn't have a dim parameter either. It is recommended to use typeutil.IsFixDimVectorType(field.GetDataType).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion!

Addressed in a5417fb by using typeutil.IsFixDimVectorType instead of IsVectorType.

@Hoyaspark Hoyaspark requested a review from xiaocai2333 April 15, 2025 10:28
@xiaocai2333
Copy link
Contributor

/lgtm
@xiaofan-luan please approve on it.

@Hoyaspark Can you pick it to 2.5 branch?

@Hoyaspark Hoyaspark changed the base branch from master to 2.5 April 15, 2025 11:33
@sre-ci-robot sre-ci-robot added size/XXL Denotes a PR that changes 1000+ lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Apr 15, 2025
Copy link
Contributor

mergify bot commented Apr 15, 2025

@Hoyaspark Please associate the related pr of master to the body of your Pull Request. (eg. “pr: #”)

@Hoyaspark Hoyaspark changed the base branch from 2.5 to master April 15, 2025 11:34
@sre-ci-robot sre-ci-robot added size/S Denotes a PR that changes 10-29 lines. and removed size/XXL Denotes a PR that changes 1000+ lines. labels Apr 15, 2025
@xiaocai2333
Copy link
Contributor

I mean cherry-pick it into a new PR based on the 2.5 branch.

@Hoyaspark
Copy link
Contributor Author

@xiaocai2333 I’ve created a new PR based on the 2.5 branch: #41329

Copy link
Contributor

mergify bot commented Apr 15, 2025

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

1 similar comment
Copy link
Contributor

mergify bot commented Apr 15, 2025

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

@Hoyaspark
Copy link
Contributor Author

/run-cpu-e2e

Copy link
Contributor

mergify bot commented Apr 15, 2025

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

@xiaocai2333
Copy link
Contributor

/run-cpu-e2e

sre-ci-robot pushed a commit that referenced this pull request Apr 16, 2025
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: czs007, Hoyaspark

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

@mergify mergify bot added the ci-passed label Apr 16, 2025
@sre-ci-robot sre-ci-robot merged commit 4be6d0e into milvus-io:master Apr 16, 2025
19 of 20 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. do-not-merge/missing-related-pr kind/bug Issues or changes related a bug lgtm size/S Denotes a PR that changes 10-29 lines.
Projects
None yet
4 participants