Repository navigation
feat: [pk-update-pr1] add Update RPC admission through Proxy and WAL - #55847
MrPresent-Han wants to merge 27 commits into
Conversation
Expose Update(UpdateRequest) and the Go SDK Update API. Carry the matching public protocol pin and UPDATE message definitions with this first split. Validate and route shared typed assignments, fence write schemas and include updates in WAL conflict admission. Keep public writes disabled by default. Exclude the later storage, compaction, Segcore and read-side implementations. Regression tests and regenerated mocks remain local for source-only review. Issue: milvus-io#55738 Design: milvus-io#55186 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
|
@MrPresent-Han This is a feature PR ( How to resolve: |
Pin the public Update request with rls_principal, skip_rls and RowPolicyAction.Update in the root, pkg and client modules. This aligns the protocol with existing DML requests; it does not enable RLS enforcement. Document that Update temporarily shares the Insert/Upsert byte-rate quota and leave independent Update rate limiting as a follow-up. Validate protocol round trips and RPC transport, SDK forwarding, Proxy/WAL compilation and targeted admission tests. Retain test files locally for the production-source review. Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Size INT64 batches by count and accumulate a conservative byte budget for string keys. Reserve 1 KiB per encrypted batch and reject an oversized encoding before WAL append, without rebuilding smaller fragments. Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
The gRPC receive limit applies to the inbound request. Allow its routed WAL messages to exceed that limit in aggregate while checking each encoded pack against the backend budget. Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
| Export: true, | ||
| } | ||
| p.ServerMaxRecvSize.Init(base.mgr) | ||
| if p.ServerMaxRecvSize.GetAsInt() <= 0 { |
There was a problem hiding this comment.
Looks like a leftover from the earlier packing code: after the last commit nothing in this PR reads ServerMaxRecvSize. This check isn't behind proxy.pkUpdate.enabled and runs in every component's init, so I'd drop it from this PR (or send it on its own if we still want it).
There was a problem hiding this comment.
Removed the global receive-size check in f466887. The PR now has no diff in grpc_param.go. I also ran the gRPC configuration tests, including initialization with zero and negative receive sizes.
| @@ -1,9 +1,18 @@ | |||
| #!/usr/bin/env bash | |||
|
|
|||
| set -euo pipefail | |||
There was a problem hiding this comment.
This script change is only needed while the fork pin is in place, so I'd drop it together with the replace lines once milvus-io/milvus-proto#700 merges, rather than land it in master.
Also, set -euo pipefail changes the normal path: if git ls-remote fails (offline, GitHub hiccup), the script now exits. Before, it fell back to the commit hash in the pseudo-version and reset the existing checkout to it.
There was a problem hiding this comment.
Agreed. The script and the three Go module replacements temporarily keep the C++ and Go bindings on the same fork revision. With set -euo pipefail, a failed git ls-remote exits before the cached-checkout fallback. I’ll restore the upstream script and remove all three replacements together once milvus-io/milvus-proto#700 merges, before merging this PR. That cleanup is still pending.
There was a problem hiding this comment.
A correction to my earlier reply: the script was restored separately in a822f8d, so its original fallback is already back. Only the three Go module replacements are waiting on milvus-io/milvus-proto#700.
There was a problem hiding this comment.
milvus-io/milvus-proto#700 has merged. In 6397d70 I removed all three fork replacements and pinned the root, pkg, client, and tests/go_client modules to the official merge commit 5b47f1d4dc26. The existing download script fetched the same revision from a clean checkout. I generated the C++ bindings and verified that regenerating the Go WAL binding matches the checked-in file byte for byte.
| if err != nil { | ||
| return failedMutationResult(err), nil | ||
| } | ||
| return result, nil |
There was a problem hiding this comment.
Insert/Upsert/Delete all call hookutil.GetExtension().Report(...) and rateCol.Add(...), and record ProxyMutationLatency after the write. Update does none of these. That's fine while the flag is off, but once it's on, updates won't be metered and won't show up in the write metrics. Could we add them here, or at least note it next to the rate-limit TODO?
There was a problem hiding this comment.
Added all three in cf19d35. After all WAL writes are acknowledged, Proxy calls Report with the request bytes and accepted PK count, adds those bytes to DMLInsert, and records one ProxyMutationLatency sample labeled update. The reported value is also returned in the response and counted in ProxyReportValue. A local Proxy test covered a two-channel update, validation rejection, and one channel failing after the other succeeded. Only the fully acknowledged request was counted.
Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
| Version: "3.0.0", | ||
| DefaultValue: "false", | ||
| Doc: "Admit new literal PK-update requests. Disabling admission does not disable replay, materialization, CDC or reads of accepted updates. Requires compatible consumers.", | ||
| Export: true, |
There was a problem hiding this comment.
Nothing applies an UPDATE yet. The delegator stream subscribes only to Insert/Delete/SchemaChange/AlterCollection/ManualFlush (msgstream_adaptor.go:114), and growingruntime falls through to default: return nil (dispatch.go:138). So if someone turns this on in master today, the client gets Acknowledged: true, but reads never change. Since the param is refreshable and listed in milvus.yaml, I'd make it Export: false until the apply path lands.
There was a problem hiding this comment.
Changed proxy.pkUpdate.enabled to Export: false and regenerated configs/milvus.yaml in 2cd05ef. It defaults to false. The query-side apply path is in a follow-up PR. I verified that a default Proxy rejects Update with ErrServiceUnimplemented and Acknowledged: false, and that the public YAML matches the generator.
| return nil, status.NewInvalidArgument("UPDATE set_null must be true") | ||
| } | ||
| } | ||
| // Enforce the text-update boundary before persistence, including writes |
There was a problem hiding this comment.
This re-checks only enable_match. All the other rules (PK/partition/clustering key, function and TTL fields, literal type, nullability) live only in Proxy, and replicated writes have already passed the source Proxy's validation against the same schema version. I'd either reuse PKUpdateFieldRestriction/SupportsPKUpdateType here, so SN and Proxy share one rule set, or drop this block and keep validation in Proxy. enable_match is also checked twice in validateUpdateAssignments already: once explicitly, and again through restricted.
There was a problem hiding this comment.
Removed the duplicate enable_match check in validateUpdateAssignments in eed4a40. The source Proxy now checks it once through PKUpdateFieldRestriction.
I kept the narrower check at the target SN because this phase cannot apply updates to enable_match VARCHAR fields. As you point out, a normal source Proxy already rejects them. On replication, CDC reads the source WAL and sends the WAL record to the target’s CreateReplicateStream. That handler calls WAL().Replicate().Append directly, bypassing the target’s Proxy.Update. If a source running another version accepts such an assignment, the target SN can reject it against its local schema before persisting it. The other request-level validation stays at the source Proxy.
There was a problem hiding this comment.
Following up on my earlier reply: e275645 replaced the text-only SN check with both shared field-eligibility checks. The target now rejects a replicated assignment to a protected or unsupported field before WAL append.
| }) | ||
| SetReportValue(result.GetStatus(), v) | ||
| metrics.ProxyReportValue.WithLabelValues(nodeID, hookutil.OpTypeUpdate, dbName, username).Add(float64(v)) | ||
| metrics.ProxyMutationLatency.WithLabelValues(nodeID, metrics.UpdateLabel, dbName, request.GetCollectionName()). |
There was a problem hiding this comment.
One more write metric to match the other DML calls: Insert/Upsert/Delete also feed ProxyReceiveBytes. They set metrics.GetStats(ctx).SetInboundLabel(...), and their methods are listed in WithInboundRecord in internal/distributed/proxy/service.go. Update does neither, so its request bytes never show up in that metric.
There was a problem hiding this comment.
Added MilvusService_Update_FullMethodName to WithInboundRecord and set the update, database, and collection labels in Proxy.Update before the admission check (eed4a40). In a local gRPC test, a request rejected with admission disabled still increased ProxyReceiveBytes by exactly proto.Size(req). Update continues to share the DMLInsert rate limit.
Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
| if err := merr.CheckRPCCall(resp, err); err != nil { | ||
| return err | ||
| } | ||
| result.UpdateCount = resp.GetUpdateCnt() |
There was a problem hiding this comment.
Insert/Upsert/Delete all call c.collCache.UpdateWriteTs(newCollectionCacheKey(db, collectionName), resp.GetTimestamp()) after a successful write. That is what lets Session reads wait for the write. Update skips it, so a Session query right after an Update won't wait for the Update's timestamp. Unless read-your-writes is intentionally not promised for Update, I think it needs the same call, keyed by c.getCurrentDB() like Delete.
There was a problem hiding this comment.
Fixed in 2680c72. After a successful Update, the Go client records the returned timestamp under the database and collection used by that RPC. The local gRPC regression test starts the cache at 100, returns 120 from Update, and checks that the next Session Query sends guarantee_timestamp=120. Failed writes and older responses leave that watermark intact.
| if schema == nil { | ||
| return nil, status.NewUnrecoverableError("cannot validate UPDATE fields: collection schema is unavailable") | ||
| } | ||
| for _, field := range schema.GetFields() { |
There was a problem hiding this comment.
Proxy already rejects enable_match fields through PKUpdateFieldRestriction, and the schema version is fenced above. So this loop re-checks only one of the Proxy rules. If SN is meant to be the backstop for replicated writes, it should probably run the whole PKUpdateFieldRestriction (PK, partition/clustering key, function fields, ...). Otherwise I'd drop it so the rule lives in one place.
There was a problem hiding this comment.
Fixed in e275645. Before WAL append, the target SN resolves each assignment by field ID against its local schema and runs the same PKUpdateFieldRestriction and SupportsPKUpdateType checks as Proxy. Unknown IDs also fail before append. Local shard tests exercised both ordinary and replication-marked messages. Literal value and nullability validation remain with the source Proxy.
| @@ -1,9 +1,18 @@ | |||
| #!/usr/bin/env bash | |||
|
|
|||
| set -euo pipefail | |||
There was a problem hiding this comment.
This change only exists to build against the temporary fork pin, which has to be replaced before merge anyway. It also changes the default C++ build path for everyone: with set -euo pipefail, ls-remote/fetch failures that used to be ignored now fail the build. I'd keep it out of this PR and send it separately if we want it.
There was a problem hiding this comment.
Restored the upstream script in a822f8d. scripts/download_milvus_proto.sh is now absent from the PR diff, including the set -euo pipefail change. The three Go module replacements still point to the temporary fork pending milvus-io/milvus-proto#700.
There was a problem hiding this comment.
The remaining fork cleanup landed in 6397d70. The Go modules now use the merged upstream protocol, and scripts/download_milvus_proto.sh has no diff against the PR base.
|
|
||
| // WithAssignment appends one typed literal assignment. Repeating a field is | ||
| // rejected by Proxy; neither assignments nor primary keys are deduplicated here. | ||
| func (opt *updateOption) WithAssignment(fieldName string, literal *schemapb.UpdateLiteral) *updateOption { |
There was a problem hiding this comment.
Since this is public SDK API, it may be worth settling the shape before it ships. Right now callers have to build a nested schemapb.UpdateLiteral oneof by hand for every value, and WithNull is the only typed helper. Typed setters (e.g. WithInt64/WithString/WithArray), or taking a Go value and converting it here, would be easier to use and harder to change later.
There was a problem hiding this comment.
Added WithInt64, WithVarchar, and WithVarcharArray in 4636326. For example, callers can now write NewUpdateOption("users").WithInt64IDs([]int64{7}).WithInt64("age", 42).WithVarcharArray("tags", []string{"beta"}). WithNull sets NULL explicitly, and WithVarcharArray("tags", nil) sets an empty array. The SDK gRPC test checks those encodings on the wire.
Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Resolve assignment field IDs against the local schema and apply the same field restrictions and supported types as Proxy. Reject unknown fields before append, including on replicated writes. Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Use the database targeted by the RPC for the collection write timestamp. A subsequent Session query can then carry the timestamp returned by Update. Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Add WithInt64, WithVarchar and WithVarcharArray to the Update option builder. Encode empty arrays as array literals and use WithNull for explicit NULL assignments. Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
liliu-z
left a comment
There was a problem hiding this comment.
Went through the Proxy → WAL admission path. No blocking issues from my side: validation, PK routing and packing, the SN-side re-check (schema version, partition, field eligibility) and joining the partial-upsert row locks all line up with how Insert/Delete work today. With proxy.pkUpdate.enabled=false the default path doesn't change. The FillWithDefaultValue refactor is equivalent, and the new UPDATE branches in the WAL interceptors never fire.
One thing for the description: bumping milvus-proto to 5b47f1d4dc26 also pulls in milvus-io/milvus-proto#697, milvus-io/milvus-proto#701 (ExecuteDQL, served as Unimplemented here) and milvus-io/milvus-proto#702 (external_field on struct array fields, unused for now). Both look inert, but probably worth listing.
| end = updatePKBatchEnd(keys, start, pkBudget, fieldOverhead) | ||
| } | ||
| body.PrimaryKeys = sliceUpdatePKs(keys, start, end) | ||
| msg, err := build(body, cipher) |
There was a problem hiding this comment.
[P1] Bound aggregate update payloads before building WAL batches
With PK-update admission enabled and proxy.splitChunk=true, a valid large ARRAY<VARCHAR> assignment can leave only 10–19 bytes in pkBudget, causing updatePKBatchEnd to emit one INT64 key per message. The default 10,000-key allowance then produces 10,000 independently serialized copies of the complete assignment payload. Under the default Pulsar limit, a roughly 2 MiB request can therefore retain roughly 19 GiB of encoded payloads in result before the first WAL append, exhausting Proxy memory even though every individual message passes the size check. Quota accounting only charges the original request bytes. Bound the aggregate encoded bytes or batch count before constructing these repeated payloads.
There was a problem hiding this comment.
Fixed in e21318f. Proxy now uses quotaAndLimits.limits.maxInsertSize (64 MiB by default) as one budget for all encoded WAL messages from an Update, across all VChannels. Each repeated assignment counts each time it is encoded. On the first message that would exceed the budget, packing stops and the request returns ErrParameterTooLarge before any WAL append. The bytes for that one message are allocated to measure its encoded size. Setting maxInsertSize to -1 disables the aggregate check. The existing per-message WAL limit still applies when Proxy splitting is enabled.
Added regression tests for crossing the budget within one VChannel and across VChannels, including the exact boundary. I also verified locally that a rejected request makes zero WAL append calls and that encrypted packing stops at the first over-budget message.
| } | ||
| if err := merr.CheckHealthy(node.GetStateCode()); err != nil { | ||
| return failedMutationResult(err), nil | ||
| } |
There was a problem hiding this comment.
rateCol.Add(internalpb.RateType_DMLInsert.String(), float64(requestSize)) counts Update against the DMLInsert quota (both the rate-limit interceptor via GetRequestInfo and the post-hoc rateCol). A heavy Update workload can starve inserts and vice versa. This is acknowledged in the code and PR body as follow-up; flagging so it is tracked and the DMLInsert quota inflation is kept in mind when tuning.
(saturnus review rvw_31b7f0f33b3da2f0, P2)
There was a problem hiding this comment.
PK Update intentionally shares the Insert/Upsert byte-rate quota in this first phase. The admission interceptor charges the serialized request size to DMLInsert, and successful Update calls report usage under that same category. Operators sizing this quota should account for all three operations. The TODO in GetRequestInfo and the PR description track a dedicated Update quota, including its configuration and distribution, as follow-up work.
congqixia
left a comment
There was a problem hiding this comment.
Adds the PK-update write path (Go SDK Client.Update, Proxy admission/validation/packing, WAL Update message type with admission interceptors) behind proxy.pkUpdate.enabled=false. The code is careful and well-documented; read/apply/CDC consumers for MessageTypeUpdate are explicitly deferred. The blocking concern is that the hot-reloadable admission gate is the only thing preventing acknowledged-but-never-applied updates (silent data loss) until those consumers land.
(saturnus review rvw_31b7f0f33b3da2f0, verdict: Request change)
Charge each encoded WAL message against one budget for the Update request before retaining it. Apply the budget across VChannels in both Proxy packing modes. Issue: milvus-io#55738 Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Keep the internal Update task available for tests, label its queue latency by operation, and add the standard license header to the field restrictions. Related to milvus-io#55738. Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
congqixia
left a comment
There was a problem hiding this comment.
This PR (revised head e069553) adds the PK-update write path: Go SDK Client.Update, Proxy DML task/validation/packing, the WAL Update message type with admission interceptors, plus protocol deps, gated behind proxy.pkUpdate.enabled=false. The two new commits fix all prior findings: the public Update RPC is now hard-blocked (ErrServiceUnimplemented) at the distributed proxy boundary until WAL consumers can apply PK updates, the queue-latency metric uses a QueueMetricLabel hook, the license header was added, and packed Update messages are bounded by quotaAndLimits.limits.maxInsertSize with tests. I re-verified the new maxInsertSize accumulation logic and the RPC block; no new issues found.
(saturnus review rvw_31b7f0f33b3da2f0, verdict: LGTM)
|
[approval-status] effective-owner-approvals=1 [congqixia(review)]; do-not-merge/disable-approve-self=not-required; do-not-merge/doc-need-two-approve=disabled; ignored=[none] |
| if err != nil { | ||
| return nil, status.NewUnrecoverableError("cannot validate update schema: %s", err) | ||
| } | ||
| body, err := update.Body(ctx) |
There was a problem hiding this comment.
[P2] Reuse the UPDATE body across WAL admission checks
When an UPDATE reaches WAL admission with streaming.partialUpdate.enableCAS=true (the default), partialupdate.extractUpdatePKs decodes its complete body for PK extraction, and this call decodes the same payload again for shard validation. Mutable Body(ctx) creates and unmarshals a fresh body on each call; the immutable-body cache does not apply. Large array assignments therefore incur an extra full protobuf decode and allocation for every WAL message, including each repeated assignment payload across channels and chunks. Reuse one append-scoped decoded UpdateMessageBody between PK tracking and shard validation. This affects the internal WAL path; the public Update RPC remains disabled.
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
| github.com/iskorotkov/avro/v2 v2.33.1 | ||
| github.com/magiconair/properties v1.8.7 | ||
| github.com/milvus-io/milvus-proto/go-api/v3 v3.0.0-20261105020509-3c2afcbf9ce6 | ||
| github.com/milvus-io/milvus-proto/go-api/v3 v3.0.0-20261124082406-5b47f1d4dc26 |
There was a problem hiding this comment.
This bump also brings in ExecuteDQL (milvus-proto #701). It and Update are now required methods of MilvusServiceServer, but internal/mocks/mock_proxy.go and client/milvusclient/mock_milvus_server_test.go weren't regenerated. As a result, the test packages internal/proxy, internal/distributed/proxy, internal/distributed/proxy/httpserver and client/milvusclient no longer compile (*mocks.MockProxy does not implement types.ProxyComponent (missing method ExecuteDQL)). All four compile on the base commit.
Could you include the regenerated mocks in this PR (MockProxy via make generate-mockery-types, plus the client's make generate-mockery)? Otherwise this breaks Go UT on master for everyone.
| // loaded collection. It does not retry schema mismatches or transport failures: | ||
| // another VChannel may already have committed, or a response may be lost after | ||
| // commit. Reissuing the request could overwrite a later writer's value. | ||
| func (c *Client) Update(ctx context.Context, option UpdateOption, callOptions ...grpc.CallOption) (UpdateResult, error) { |
There was a problem hiding this comment.
In this PR the server returns Unimplemented for every Update call. Would it make sense to hold Client.Update / NewUpdateOption until the apply and read side lands? Once a client release ships them, the option and result shapes are effectively frozen, and the RPC has already been renamed once.
congqixia
left a comment
There was a problem hiding this comment.
This PR adds the PK-update write path (SDK Client.Update, Proxy validation/packing/DML task, WAL MessageTypeUpdate with admission interceptors, protocol deps) behind a hard-blocked public RPC. This round's delta (e9a6c71) refactors the WAL interceptors to decode the Update body once per append via a context-cached DecodeUpdateBody, with thorough tests; the master merge adapted pk_update_fields.go to IsTextMatchEnabled and regenerated messages.pb.go consistently. All four prior findings remain resolved; no new issues found in the new commit or the merge integration.
(saturnus review rvw_31b7f0f33b3da2f0, verdict: LGTM)
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Defer the public Go SDK Update API until read and apply support is available. Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Carry the partition scope in the Update header so shard admission can check routing and schema without decoding assignments. Keep assignment validation in the source Proxy and decode the body when extracting write-set keys. Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
liliu-z
left a comment
There was a problem hiding this comment.
Rechecked the commits since my last pass (now at acb129a). My earlier points are addressed: the mocks are regenerated, the Go SDK API is deferred, and the SN check now only reads the header. Keeping field eligibility checks only in Proxy looks fine to me. Alter field, changing the TTL field and schema/function changes all bump the schema version on master, so the SN version check still catches them.
No blocking issues from my side. One thing is left before merge: commonpb.MsgType_Update isn't in 5b47f1d4dc26, so internal/proxy/dml won't build until milvus-io/milvus-proto#706 merges and go.mod is bumped again. One small cleanup inline.
| SetInboundLabel(metrics.UpdateLabel). | ||
| SetDatabaseName(request.GetDbName()). | ||
| SetCollectionName(request.GetCollectionName()) | ||
| // Enable public writes only after WAL consumers can apply and serve PK updates. |
There was a problem hiding this comment.
With this hard return, proxy.pkUpdate.enabled no longer gates anything in a running server. Only Proxy.Update reads it, and outside tests nothing calls Proxy.Update. TestPublicUpdateBlockedUntilConsumersReady even checks that flipping it changes nothing. So we have two gates for one thing, plus a hidden, refreshable param that has no effect yet.
I'd keep only this gate. Drop PKUpdateEnabled and its check in Proxy.Update, and let the PR that adds the consumers change this to return s.proxy.Update(ctx, request). That PR can add a rollout flag if one is still needed.
There was a problem hiding this comment.
You're right that changing proxy.pkUpdate.enabled has no effect on the public RPC in this PR. We're keeping the hidden, default-off setting so that deploying the consumers and admitting the first public writes can be separate rollout steps. Once consumers can persist, replay, and serve updates, the RPC can delegate to Proxy.Update, which already checks the setting. Until then the public RPC returns ErrServiceUnimplemented for either flag value. I've documented the rollout sequence.
| func (t *UpdateTask) PostExecute(context.Context) error { return nil } | ||
| func (t *UpdateTask) Result() *milvuspb.MutationResult { return t.result } | ||
|
|
||
| func (t *UpdateTask) Type() commonpb.MsgType { return commonpb.MsgType_Update } |
There was a problem hiding this comment.
[P1] Pin a protocol revision that defines MsgType_Update
The root, pkg, and client modules pin milvus-proto revision 5b47f1d4dc26, whose proto/common.proto does not define Update in the MsgType enum. Referencing commonpb.MsgType_Update therefore leaves internal/proxy/dml and the Proxy packages that import it unable to compile, even with Update admission disabled. Update the protocol dependency to a revision containing this enum before using the constant.
congqixia
left a comment
There was a problem hiding this comment.
This round (head acb129a) makes the PK-update PR more conservative and cleaner: the public Go SDK Update API is deferred entirely (c23edf0), the Proxy Update handler moved into impl.go while the RPC stays hard-blocked at service.go:966, UpdateTask.Type() now returns the protocol commonpb.MsgType_Update (reverting the QueueMetricLabel workaround), and the partition scope moved into UpdateMessageHeader so shard admission validates collection/schema/partition without decoding the body (acb129a). Mocks regenerated; no leftover SDK Update references; generated messages.pb.go matches the proto. All prior findings remain resolved; no new blocking issues found.
(saturnus review rvw_31b7f0f33b3da2f0, verdict: LGTM)
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: congqixia 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 |
Signed-off-by: MrPresent-Han <chunhan20230315@gmail.com>
Adds the public
Update(UpdateRequest)RPC, plus the internal Proxy-to-WAL admission path. All PKs receive one shared set of typed assignments. The public RPC returnsErrServiceUnimplementedfor either value ofproxy.pkUpdate.enableduntil WAL consumers can apply updates and queries can read them.This is the first independent PR extracted from #55742, based on master. It includes the protocol dependencies needed by this write-entry path; there is no prerequisite Milvus implementation PR.
Scope:
set_null=true, restricted-field checks includingenable_match, VChannel routing, message packing and schema-cache invalidation.pkg,client, andtests/go_clientGo modules use official milvus-proto commit5b47f1d4dc26(feat: define primary-key update request and shared literals milvus-proto#700). The existing download script fetched the same revision from a clean checkout; C++ bindings were generated and the regenerated Go WAL binding matched the checked-in file byte for byte.The public Update request now preserves the same RLS wire fields as other DML and has its own RowPolicyAction. This aligns the protocol only; RLS enforcement remains absent as in master. Update still shares the Insert/Upsert byte-rate quota; a source TODO records independent Update rate limiting as follow-up work.
Segcore, delta persistence, compaction, QN/SN apply, read admission and GC remain in later parts.
Validation:
/milvus.proto.milvus.MilvusService/Update, absence of the old endpoint, literal wire round trips and unchanged Upsert privilege metadata.The PR includes the two generated service mocks with
ExecuteDQLandUpdate, plus focused regressions for packing, public admission and the queue metric. Broader development tests were run locally. The server handler is next toProxy.Upsertand uses the existing DML queue. The Go SDK public API is deferred.Clean-checkout validation at
c23edf0613(before the task type change)client/milvusclientpackage passed. Fresh Linux builds ofinternal/proxy,internal/distributed/proxyandinternal/distributed/proxy/httpserverpassed their focused tests, includingTestPublicUpdateBlockedUntilConsumersReadywith both values of the feature switch.Draft build dependency.
UpdateTask.Type()now returnscommonpb.MsgType_Update, and queue metrics use the standardt.Type().String(). The pinned proto revision5b47f1d4dc26lacks this enum, so the Proxy DML package currently fails to compile. Upgrade the dependency after milvus-proto #706 merges.TestUpdateTaskTypepassed locally against the proposed enum.Issue: #55738
design doc: docs/design-docs/design_docs/20261125-pk-update-proxy-wal.md
Design: #55186 — implementation plan
Public protocol: milvus-io/milvus-proto#700
The RPC rename revises an unreleased feature and requires matching clients and servers. Request field numbers and update semantics are unchanged. Existing instances, collections, data and the original feature branch are preserved.