Skip to content

Align GetLoadState/LoadCollection/LoadPartitions with PyMilvus#503

Merged
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:ma
Jun 4, 2026
Merged

Align GetLoadState/LoadCollection/LoadPartitions with PyMilvus#503
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:ma

Conversation

@yhmo
Copy link
Copy Markdown
Collaborator

@yhmo yhmo commented Jun 2, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 2, 2026 03:59
@sre-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo

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

The pull request process is described here

Details 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
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the SDK's segment info and load state responses to expose additional fields returned by newer Milvus proto: CollectionName, Level, StorageVersion, IsSorted, MemSize on segment info, and RefreshProgress on GetLoadStateResponse. It also adds a new SegmentLevel enum with conversion helpers between SDK and proto representations and threads the new field through both MilvusClientImpl and MilvusClientV2Impl.

Changes:

  • Add SegmentLevel enum + SegmentLevelCast conversions, and extend SegmentInfo/QuerySegmentInfo with new fields and overloaded constructors.
  • Extend GetLoadStateResponse with RefreshProgress and add a new ConnectionHandler::GetLoadingProgress overload that propagates refresh_progress from the server.
  • Populate the new fields in both client implementations when parsing GetPersistentSegmentInfo/GetQuerySegmentInfo responses; update comparators and tests accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/include/milvus/types/SegmentInfo.h Adds SegmentLevel enum and extended constructors/getters for the new segment fields.
src/impl/types/SegmentInfo.cpp Implements new constructors/getters; delegates old ctors to new ones with default values.
src/include/milvus/response/collection/GetLoadStateResponse.h Adds RefreshProgress getter/setter and backing field.
src/impl/response/collection/GetLoadStateResponse.cpp Implements RefreshProgress/SetRefreshProgress.
src/impl/utils/TypeUtils.h Declares SegmentLevelCast conversions.
src/impl/utils/TypeUtils.cpp Implements bidirectional SegmentLevelCast; unknown maps to proto Legacy.
src/impl/utils/ConnectionHandler.h Adds overload of GetLoadingProgress with refresh_progress out parameter.
src/impl/utils/ConnectionHandler.cpp Implements the new overload; old overload delegates with a discarded refresh value.
src/impl/utils/CompareUtils.cpp Updates operator== for SegmentInfo/QuerySegmentInfo to include new fields (and uses NodeIDs() instead of NodeID()).
src/impl/MilvusClientImpl.cpp Captures collection_name in lambdas and populates new fields on segment info; reserves node id vector.
src/impl/MilvusClientV2Impl.cpp Same as above for V2 client; also initializes Progress/RefreshProgress before loading branch.
test/ut/types/TestSegmentInfo.cpp New tests for default values and extended constructors; removes stale comments.
test/ut/utils/TestTypeUtils.cpp Adds round-trip test for SegmentLevelCast and an invalid-value test.
test/ut/response/TestCollectionResponses.cpp Adds setter/getter test for RefreshProgress.
test/it/v1/TestGetPersistentSegmentInfo.cpp Updates mock to exercise new fields.
test/it/v1/TestGetQuerySegmentInfo.cpp Updates mock to exercise new fields including MemSize and multiple node ids.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yhmo yhmo changed the title Add segment info response parity fields Add GetLoadState refresh progress and segment info parity Jun 2, 2026
@yhmo yhmo requested a review from Copilot June 2, 2026 04:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.75%. Comparing base (a0592aa) to head (dd0f068).
⚠️ Report is 106 commits behind head on master.

Files with missing lines Patch % Lines
src/impl/MilvusClientV2Impl.cpp 55.88% 15 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #503       +/-   ##
===========================================
+ Coverage   53.47%   77.75%   +24.27%     
===========================================
  Files          52      304      +252     
  Lines        4432    13654     +9222     
  Branches        0     1325     +1325     
===========================================
+ Hits         2370    10616     +8246     
- Misses       2062     2929      +867     
- Partials        0      109      +109     
Files with missing lines Coverage Δ
src/impl/MilvusClientImpl.cpp 79.69% <100.00%> (-12.66%) ⬇️
src/impl/MilvusConnection.cpp 88.04% <ø> (+27.88%) ⬆️
src/impl/types/SegmentInfo.cpp 100.00% <100.00%> (ø)
src/impl/utils/CompareUtils.cpp 83.58% <100.00%> (ø)
src/impl/utils/ConnectionHandler.cpp 87.35% <100.00%> (ø)
src/impl/utils/ConnectionHandler.h 83.33% <ø> (ø)
src/impl/utils/TypeUtils.cpp 90.90% <100.00%> (ø)
src/include/milvus/MilvusClientV2.h 100.00% <ø> (ø)
src/impl/MilvusClientV2Impl.cpp 63.70% <55.88%> (ø)

... and 312 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
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 3 comments.

Comment thread src/impl/utils/TypeUtils.cpp
Comment thread src/impl/utils/ConnectionHandler.h Outdated
Comment thread CMakeLists.txt
@yhmo yhmo changed the title Add GetLoadState refresh progress and segment info parity Align GetLoadState/LoadCollection/LoadPartitions with PyMilvus Jun 3, 2026
@mergify mergify Bot removed the ci-passed label Jun 3, 2026
@yhmo yhmo requested a review from Copilot June 3, 2026 09:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

scripts/build.sh:39

  • JOBS is now user-overridable via environment, but the script assumes it is an integer. If someone sets JOBS to a non-numeric value (or an empty string), the numeric comparisons and subsequent -j${JOBS} usage can behave unpredictably. Consider validating JOBS and falling back to the auto-detected default when it is not a non-negative integer.
JOBS="${JOBS:-$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 3)}"
if [ ${JOBS} -lt 3 ] ; then
    JOBS=3
fi
if [ ${JOBS} -gt 10 ] ; then

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

scripts/build.sh:39

  • JOBS is now user-overridable via the environment, but it is used in numeric comparisons below. If JOBS is non-numeric (or contains shell metacharacters), the [ ${JOBS} -lt 3 ] / -gt tests can fail with a syntax error and may allow unintended shell parsing. Validate that JOBS is an integer before using it in arithmetic comparisons.
JOBS="${JOBS:-$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 3)}"
if [ ${JOBS} -lt 3 ] ; then
    JOBS=3
fi
if [ ${JOBS} -gt 10 ] ; then

Comment thread scripts/build.sh
Signed-off-by: yhmo <yihua.mo@zilliz.com>
@mergify mergify Bot added the ci-passed label Jun 3, 2026
@yhmo yhmo added the lgtm label Jun 4, 2026
@sre-ci-robot sre-ci-robot merged commit 54a0b5e into milvus-io:master Jun 4, 2026
12 checks passed
@yhmo yhmo deleted the ma branch June 4, 2026 04:20
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.

3 participants