Repository navigation
feat: Support conditional upsert in MilvusClient - #3896
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3896 +/- ##
=======================================
Coverage 94.89% 94.90%
=======================================
Files 81 81
Lines 17784 17809 +25
=======================================
+ Hits 16877 16902 +25
Misses 907 907 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
weiliu1031
force-pushed
the
conditional-write-sdk
branch
from
November 17, 2026 03:12
4f7e51b to
aac2451
Compare
weiliu1031
marked this pull request as ready for review
November 17, 2026 03:12
|
This pull request is merged. |
weiliu1031
force-pushed
the
conditional-write-sdk
branch
from
November 26, 2026 02:44
aac2451 to
b9404d5
Compare
issue: milvus-io/milvus#54532 Add write_condition and written-row succ_index support to synchronous and asynchronous MilvusClient upserts: - Validate and pack GT/GTE integer-version conditions with insert/skip/error missing-row policies in Prepare.row_upsert_param. - Auto-promote partial_update when write_condition is set; reject incompatible field_ops (non-REPLACE on the version field, or any non-REPLACE op with GTE). - Raise DataNotMatchException when the condition field is missing from the cached schema so existing schema-refresh retry can recover. - Return succ_index aligned with written IDs only when write_condition is supplied; leave ordinary upsert responses unchanged. Validation: - uv run --frozen --group dev pytest tests/unit/prepare/test_partial_op.py tests/unit/grpc_handler/test_data.py tests/unit/async_grpc_handler/test_async_data.py tests/unit/test_milvus_client.py tests/unit/test_async_milvus_client_reuse.py -q - Ruff, Black, and git diff --check passed. Signed-off-by: Wei Liu <wei.liu@zilliz.com>
weiliu1031
force-pushed
the
conditional-write-sdk
branch
from
November 26, 2026 03:06
b9404d5 to
fd09f67
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: weiliu1031, XuanYang-cn 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 |
Collaborator
|
✅ Backport Created (cc @XuanYang-cn) |
pymilvus-bot
added a commit
to pymilvus-bot/pymilvus
that referenced
this pull request
Nov 26, 2026
Pin milvus-proto to milvus-io/milvus-proto#685 and regenerate the Python bindings. This gives the synchronous and asynchronous upsert paths in milvus-io#3896 the WriteCondition message they serialize. pr: milvus-io#3952 See also: milvus-io/milvus#54532 Signed-off-by: pymilvus-bot <pymilvus@zilliz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue: milvus-io/milvus#54532
Add
write_conditionand written-rowsucc_indexsupport to synchronous and asynchronousMilvusClient.upsert.Behavior
GT/GTEinteger-version conditions andinsert/skip/errorpolicies for missing rows.partial_update.DataNotMatchExceptionwhen the condition field is absent from the cached schema so existing schema-refresh retry can recover.PATH_REPLACEandfield_opspacking:GTpermits operations on non-version fields;GTErequiresREPLACEoperations; the version field itself requiresREPLACE.succ_index) aligned with writtenidswhenwrite_conditionis supplied; omitted/skipped rows do not appear. Ordinary upsert response shapes remain unchanged.Upstream alignment
Rebased onto PyMilvus master
ff967fd4f6ec4c10215bc966c396438b75935d59. The inherited proto submodule already contains the merged conditional-write protocol, so this PR carries no separate proto pin or generated-file diff.Server implementation: merged Milvus PR #54697.
Design: Conditional upsert.
Upgrade every serving Proxy before enabling conditional traffic. Old Proxies can silently ignore the field and perform unconditional writes.
Validation
ff967fd4: 404 passed (prepare,grpc_handler,async_grpc_handler,MilvusClient,AsyncMilvusClient).git diff --checkpassed.