mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
## Summary - Add `PinnedRef[T]` smart pointer and `NewSharedPinnedRefs` for ref-counted ownership across merged search tasks - Add `PinnedResourceManager` (sync.Map registry) and `MsgPins` global instance; `MsgPinnable` marker interface limits codec overhead to `SearchResults` only - Add `releaseCodec` (gRPC `CodecV2` wrapper) that frees pinned C memory after marshaling - Two-phase reduce in `SearchTask.Execute`: Phase 1 builds results with full cleanup on error; Phase 2 pins blobs or releases C memory immediately - Gate entire zero-copy path with `QueryNodeCfg.EnableResultZeroCopy` (default off) issue: #48668 ## Test plan - [ ] `go test ./pkg/util/resource/...` — PinnedRef, PinnedResourceManager, releaseCodec unit tests - [ ] `go test ./internal/querynodev2/tasks/...` — SearchTask two-phase reduce - [ ] `go test ./internal/proxy/...` — delegator reduce path - [ ] Enable `queryNode.enableResultZeroCopy: true` and run search workload end-to-end 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>