Align GetLoadState/LoadCollection/LoadPartitions with PyMilvus#503
Conversation
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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
SegmentLevelenum +SegmentLevelCastconversions, and extendSegmentInfo/QuerySegmentInfowith new fields and overloaded constructors. - Extend
GetLoadStateResponsewithRefreshProgressand add a newConnectionHandler::GetLoadingProgressoverload that propagatesrefresh_progressfrom the server. - Populate the new fields in both client implementations when parsing
GetPersistentSegmentInfo/GetQuerySegmentInforesponses; 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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
JOBSis now user-overridable via environment, but the script assumes it is an integer. If someone setsJOBSto a non-numeric value (or an empty string), the numeric comparisons and subsequent-j${JOBS}usage can behave unpredictably. Consider validatingJOBSand 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
There was a problem hiding this comment.
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 ]/-gttests 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
Signed-off-by: yhmo <yihua.mo@zilliz.com>
No description provided.