mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
UpsertRequest carries `bool partial_update`, and task_upsert may
implicitly promote a request to partial_update=true when any field
carries a FieldPartialUpdateOp != REPLACE. Today the proxy access log
exposes neither — every Upsert line falls through to the generic `base`
formatter and operators triaging a partial-update incident cannot tell
from logs alone whether a given Upsert was full or partial.
Add `$partial_update` to the access-log formatter vocabulary alongside
the existing 27 metrics:
- info.go: register $partial_update in MetricFuncMap; add
PartialUpdate() string to the AccessInfo interface; add the
getPartialUpdate delegator.
- grpc_info.go / restful_info.go: implement PartialUpdate() — type-
assert *milvuspb.UpsertRequest and return fmt.Sprint of
GetPartialUpdate(); return NotAny ("n/a") for any other type.
- configs/milvus.yaml: add a dedicated `upsert` formatter bound to
methods: "Upsert" so the new field shows up out of the box without
polluting the shared `base` formatter.
Implicit promotion (task_upsert.go:1308-1309) is reflected for free:
UnaryAccessLogInterceptor writes the log after handler() returns, and
the *UpsertRequest pointer on GrpcAccessInfo is the same instance the
task mutates, so the type-asserted GetPartialUpdate() reads the promoted
value without any SetPartialUpdate(ctx, …) writeback.
Tests: TestPartialUpdate added to both GrpcAccessInfoSuite and
RestfulAccessInfoSuite (non-Upsert -> "n/a"; PartialUpdate=false ->
"false"; PartialUpdate=true -> "true"). Both suites stay green
end-to-end.
issue: #49347
---------
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>