Commit Graph

183 Commits (17532517c611cafe5ec7a79bda47c9f296e82682)

Author SHA1 Message Date
yihao.dai cc792486a8
feat: Support force promote for primary-secondary failover (#47352)
Add force_promote flag to UpdateReplicateConfiguration API for disaster
recovery.

Changes:

- Add ForcePromote field to UpdateReplicateConfigurationRequest

- Refactor UpdateReplicateConfiguration to accept request object instead
of separate params

- Add WithForcePromote() method to ReplicateConfigurationBuilder

- Implement force promote validation and handling in assignment service

- Add integration tests for force promote scenarios

Force promote allows a secondary cluster to immediately become
standalone primary

when the original primary is unavailable, enabling active-passive
failover.

issue: https://github.com/milvus-io/milvus/issues/47351

design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260202-force_promote_failover.md

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: Yihao Dai <yihao.dai@zilliz.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-20 16:09:28 +08:00
sijie-ni-0214 3f16b853fb
feat: add TruncateCollection to Go SDK client (#48334)
## Summary
- Add `TruncateCollection` method to the Go SDK client
(`client/milvusclient`)
- Add `TruncateCollectionOption` interface and
`NewTruncateCollectionOption` constructor
- Add unit tests covering success and failure cases

issue: #46166
doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260129-truncate_collection.md

## Test plan
- [x] Unit tests pass (`TestTruncateCollection` success/failure)
- [x] E2E verified: insert → truncate → verify empty → re-insert →
verify data
- [x] E2E verified: truncate loaded collection + search returns empty
- [x] E2E verified: truncate empty collection succeeds
- [x] E2E verified: truncate non-existent collection returns error

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Signed-off-by: sijie-ni-0214 <sijie.ni@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 01:09:30 +08:00
Li Liu f1bb8356eb
enhance: upgrade Go dependencies (casbin, gin, lo, cockroachdb/errors) (#47943)
## Summary
- Upgrade Go dependencies across root, pkg, and client modules:
  - `casbin/casbin` v2.44.2 → v2.135.0
  - `gin-gonic/gin` v1.9.1 → v1.11.0
  - `samber/lo` v1.27.0 → v1.52.0
  - `cockroachdb/errors` v1.9.1 → v1.12.0
  - `google.golang.org/protobuf` v1.36.5 → v1.36.9
- Adapt source code to breaking API changes:
- `lo.Last()` now returns `(T, bool)` instead of `(T, error)` (lo v1.52)
- `gin.LogFormatterParams.Keys` is now `map[any]any` instead of
`map[string]any` (gin v1.11)

issue: https://github.com/milvus-io/milvus/issues/33482

## Test plan
- [x] `go mod tidy` clean on all three modules (root, pkg, client)
- [x] Local lint passes with no new errors
- [ ] CI code-check passes
- [ ] CI ut-go passes
- [ ] CI e2e passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 21:11:26 +08:00
Spade A f163e94ff1
feat: impl StructArray -- support element-level query (#47906)
issue: https://github.com/milvus-io/milvus/issues/42148
design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260306-struct.md

---------

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2026-03-13 17:55:29 +08:00
congqixia 6b910a0074
enhance: bump OpenTelemetry to v1.40.0 to fix CWE-426 untrusted search path (#48058)
Related to #48070

Upgrade go.opentelemetry.io/otel and related packages from v1.34.0 to
v1.40.0 across all Go modules to address CWE-426 (Untrusted Search Path)
vulnerability. Also bumps transitive dependencies including auto/sdk
v1.1.0 -> v1.2.1, go-logr v1.4.2 -> v1.4.3, and golang.org/x/sys v0.38.0
-> v0.40.0.

See: https://cwe.mitre.org/data/definitions/426.html

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2026-03-09 10:57:22 +08:00
yihao.dai 5748d8df4f
enhance: add per-cluster TLS config for CDC outbound mTLS connections (#47968)
## Summary
- Add `BuildTLSConfig` helper and `TLSConfig` field to SDK
`ClientConfig` for mTLS support
- Add `GetClusterTLSConfig(clusterID)` for dynamic per-cluster
paramtable lookup via
`tls.clusters.<clusterID>.{caPemPath,clientPemPath,clientKeyPath}`
- CDC `NewMilvusClient` reads per-cluster TLS config by target cluster
ID, enabling different certs per target cluster

All target clusters' certs are pre-configured on every node, so CDC
topology switchover (e.g., A→B,C to B→A,C) works without process
restart.

## Test plan
- [x] Unit tests for `BuildTLSConfig` (valid certs, missing CA, invalid
cert pair)
- [x] Unit tests for `GetClusterTLSConfig` (per-cluster lookup, missing
config)
- [x] Unit tests for `buildCDCTLSConfig` (no config, partial config,
invalid CA, per-cluster isolation)

issue: #47843

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 11:27:20 +08:00
wei liu 6b4171e7ac
feat: [ExternalTable Part3] Support manual refresh for external collections (#47492)
design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260105-external_table.md

issue: #45881

This change introduces manual refresh capability for external
collections, allowing users to trigger on-demand data synchronization
from external sources. It replaces the legacy update mechanism with a
more robust job-task hierarchy and persistent state management.

Key changes:
- Add RefreshExternalCollection, GetRefreshExternalCollectionProgress,
  and ListRefreshExternalCollectionJobs APIs across Client, Proxy,
  and DataCoord
- Implement ExternalCollectionRefreshManager to manage refresh jobs
  with a 1:N Job-Task hierarchy
- Add ExternalCollectionRefreshMeta for persistent storage of jobs and
  tasks in the metastore
- Add ExternalCollectionRefreshChecker for task state management and
  worker assignment
- Implement ExternalCollectionRefreshInspector for periodic job
  cleanup
- Use WAL Broadcast mechanism for distributed consistency and
  idempotency
- Replace legacy external_collection_inspector and update tasks with
  the new refresh-based implementation
- Add comprehensive unit tests for refresh job lifecycle and state
  transitions
  
design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260105-external_table.md

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2026-02-26 11:20:46 +08:00
congqixia 8e8e793c2a
enhance: [GoSDK] support pointer types for nullable columns in row-based API (#47712)
Related to #47711

Enable Go pointer struct fields (*string, *int32, etc.) to represent
nullable columns in the row-based data processing path. A nil pointer
maps to a NULL value in Milvus; a non-nil pointer dereferences to the
actual value.

Changes:
- ParseSchema: pointer fields auto-infer Nullable=true (PK excluded)
- AnyToColumns: use reflect.Value.IsNil() to call AppendNull for nil
pointers, Elem().Interface() for non-nil — bypasses Go's typed-nil
problem where (*T)(nil) as interface{} is != nil
- SetField: wrap/unwrap pointer values during field assignment
- fillData/fillPKEntry: check IsNull() on columns and set nil pointers
for null values, wrap non-null values in reflect.New pointers
- Dynamic field path: same nil/deref logic for pointer fields going into
the JSON dynamic column

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2026-02-10 18:48:42 +08:00
yanliang567 3659ac483c
feat: [Go SDK] Support search by primary key IDs (#47633)
issue: https://github.com/milvus-io/milvus/issues/46879
design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20230403-search_by_pk.md

## Summary
- Add `NewSearchByIDsOption` constructor for searching by primary key
IDs, bringing Go SDK feature parity with Python SDK (PR #46993)
- Add `AnnRequest.WithIDs()` method and `column2IDs` helper for ID-based
search
- Add comprehensive E2E tests covering float/binary/sparse vectors,
nullable fields, duplicate IDs, invalid IDs, range search, hybrid
search, and search iterator compatibility

## API Design
```go
// Vector search (existing)
opt := client.NewSearchOption(collName, 10, vectors)

// Search by IDs (new)
idColumn := column.NewColumnInt64("id", []int64{1, 2, 3})
opt := client.NewSearchByIDsOption(collName, 10, idColumn)
```

## Test plan
- [x] Unit tests for `NewSearchByIDsOption`, `column2IDs`,
`AnnRequest.WithIDs`
- [x] E2E: float vector search by PK with self-match verification (FLAT
index + COSINE)
- [x] E2E: binary vector search by PK (VarChar PK)
- [x] E2E: sparse vector search by PK (non-nullable)
- [x] E2E: nullable sparse vector field with mixed null/non-null IDs
- [x] E2E: empty IDs error handling
- [x] E2E: duplicate IDs error handling
- [x] E2E: non-existent IDs error handling
- [x] E2E: search by IDs with filter expression
- [x] E2E: search by IDs with group by
- [x] E2E: search by IDs with output fields
- [x] E2E: search by IDs with range search parameters
- [x] E2E: hybrid search does not support search by IDs (negative test)
- [x] E2E: search iterator does not support search by IDs (documented)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: yanliang567 <yanliang.qly@gmail.com>
Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 10:52:54 +08:00
Li Liu f36ed5500b
enhance: Bump Go version to 1.24.12 and upgrade gpgv fixing CVEs (#47541)
- Upgrade Go from 1.24.11 to 1.24.12 to fix CVE-2025-61726 (net/url
query parameter DoS) and CVE-2025-61728 (archive/zip CPU exhaustion)
- Upgrade gpgv in Ubuntu Dockerfiles to fix CVE-2025-68973 (GnuPG
out-of-bounds write vulnerability)

Signed-off-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:19:50 +08:00
Li Liu 30417cd6a0
enhance: improve performance of telemetry (#47542)
Signed-off-by: Li Liu <li.liu@zilliz.com>
2026-02-04 16:57:50 +08:00
Xiaofan 8b6a3a0aa4
feat: Add client-side telemetry with heartbeat and server command support (#47523)
issue: #47281
design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260131-client_side_telemetry.md

Implement comprehensive client-side telemetry system that includes:

- Metrics collection for Search, Query, Insert, Delete, Upsert
operations
- Automatic heartbeat reporting to server with configurable intervals
- Per-collection metrics tracking with wildcard support
- P99 latency calculation using ring buffer sampling
- Server-push command handling (push_config, collection_metrics,
show_errors)
- Historical snapshot storage for latency history queries
- Error tracking with circular buffer for recent errors
- WebUI for telemetry visualization and command management
- HTTP API endpoints for telemetry data access and command push
- RootCoord telemetry manager for centralized command routing

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
2026-02-04 00:03:50 +08:00
yihao.dai e1f5dafef9
feat: Add GetReplicateConfiguration API (#47393)
## Summary

Add a new public API `GetReplicateConfiguration` that allows cluster
administrators to view the current cross-cluster replication topology
with sensitive connection parameters (tokens) redacted.

## Changes

- Add privilege constant `PrivilegeGetReplicateConfiguration` to
`ClusterReadOnlyPrivileges`
- Add `SanitizeReplicateConfiguration` helper to strip sensitive tokens
before returning
- Add `GetReplicateConfiguration` method to `ReplicateService` interface
- Implement `GetReplicateConfiguration` handler in Proxy
- Add integration tests

## API

```protobuf
rpc GetReplicateConfiguration(GetReplicateConfigurationRequest) returns (GetReplicateConfigurationResponse) {}
```

**Security:**
- Requires ClusterAdmin privilege
- Tokens are redacted from the response

## Dependencies

- Proto changes: milvus-io/milvus-proto#566

## Related Issue

Closes #47392

## Design Doc

design doc:
https://github.com/milvus-io/milvus-design-docs/blob/main/design_docs/20260128-get_replicate_configuration.md

## Test Plan

- [x] Unit tests for sanitization helper
- [x] Unit tests for ReplicateService method
- [x] Integration tests for the API

---

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
2026-02-03 15:32:34 +08:00
congqixia b389068584
fix: [GoSDK] align timestamptz field type and data format with server (#47304)
Related to #47303

The Go SDK had two issues with Timestamptz field type:

1. FieldTypeTimestamptz was incorrectly defined as 15, but server
expects 26
2. Timestamptz data was serialized as int64 via TimestamptzData, but
server expects ISO 8601 strings (RFC3339Nano format) via StringData

Changes:
- Update FieldTypeTimestamptz value from 15 to 26
- Modify ColumnTimestamptz to store data as RFC3339Nano strings
internally
- Change NewColumnTimestamptz to accept []time.Time and convert to ISO
strings
- Add ColumnTimestampTzIsoString for direct ISO string input
- Update FieldDataColumn to parse Timestamptz from StringData
- Update values2Scalars to handle Timestamptz as string type
- Add NewNullableColumnTimestamptz for nullable time.Time input
- Update NewNullableColumnTimestamptzIsoString for nullable ISO string
input
- Add corresponding unit tests

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2026-01-26 19:51:32 +08:00
Xiaofan 70377ea765
fix: Add forceDrop option to DropRole client API (#47071)
issue: #46887

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
2026-01-19 21:45:30 +08:00
cqy123456 eb63a363bd
enhance: support minhash function in DIDO (#45322)
issue : https://github.com/milvus-io/milvus/issues/41746
This PR adds MinHash "DIDO" (Data In, Data Out) support to Milvus, which
allows computing MinHash signatures on-the-fly during search operations
instead of requiring pre-stored vectors.

  Key changes:
- Implemented SIMD-optimized C++ MinHash computation (AVX2/AVX512 for
x86, NEON/SVE for ARM)
- Added runtime CPU detection and function hooks to automatically select
the best SIMD implementation
- Integrated MinHash computation into search pipeline (brute force
search, growing segment search)
- Added support for LSH-based MinHash search with configurable band
width and bit width parameters
- Enabled direct text-to-signature conversion during query execution,
reducing storage overhead

This enables efficient text deduplication and similarity search without
storing pre-computed MinHash vectors.

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
2026-01-14 14:19:27 +08:00
wei liu b79a655f1c
feat: [ExternalTable Part1] Enable create external collection (#46886)
issue: #45881

- Add ExternalSource and ExternalSpec fields to collection schema
- Add ExternalField mapping for field schema to map external columns
- Implement ValidateExternalCollectionSchema() to enforce restrictions:
  - No primary key (virtual PK generated automatically)
  - No dynamic fields, partition keys, clustering keys, or auto ID
  - No text match or function features
  - All user fields must have external_field mapping
- Return virtual PK schema for external collections in
GetPrimaryFieldSchema()
- Skip primary key validation for external collections during creation
- Add comprehensive unit tests and integration tests
- Add design document and user guide

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
Co-authored-by: sunby <sunbingyi1992@gmail.com>
2026-01-13 10:15:27 +08:00
wei liu 975c91df16
feat: Add comprehensive snapshot functionality for collections (#44361)
issue: #44358

Implement complete snapshot management system including creation,
deletion, listing, description, and restoration capabilities across all
system components.

Key features:
- Create snapshots for entire collections
- Drop snapshots by name with proper cleanup
- List snapshots with collection filtering
- Describe snapshot details and metadata

Components added/modified:
- Client SDK with full snapshot API support and options
- DataCoord snapshot service with metadata management
- Proxy layer with task-based snapshot operations
- Protocol buffer definitions for snapshot RPCs
- Comprehensive unit tests with mockey framework
- Integration tests for end-to-end validation

Technical implementation:
- Snapshot metadata storage in etcd with proper indexing
- File-based snapshot data persistence in object storage
- Garbage collection integration for snapshot cleanup
- Error handling and validation across all operations
- Thread-safe operations with proper locking mechanisms

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant/assumption: snapshots are immutable point‑in‑time
captures identified by (collection, snapshot name/ID); etcd snapshot
metadata is authoritative for lifecycle (PENDING → COMMITTED → DELETING)
and per‑segment manifests live in object storage (Avro / StorageV2). GC
and restore logic must see snapshotRefIndex loaded
(snapshotMeta.IsRefIndexLoaded) before reclaiming or relying on
segment/index files.

- New capability added: full end‑to‑end snapshot subsystem — client SDK
APIs (Create/Drop/List/Describe/Restore + restore job queries),
DataCoord SnapshotWriter/Reader (Avro + StorageV2 manifests),
snapshotMeta in meta, SnapshotManager orchestration
(create/drop/describe/list/restore), copy‑segment restore
tasks/inspector/checker, proxy & RPC surface, GC integration, and
docs/tests — enabling point‑in‑time collection snapshots persisted to
object storage and restorations orchestrated across components.

- Logic removed/simplified and why: duplicated recursive
compaction/delta‑log traversal and ad‑hoc lookup code were consolidated
behind two focused APIs/owners (Handler.GetDeltaLogFromCompactTo for
delta traversal and SnapshotManager/SnapshotReader for snapshot I/O).
MixCoord/coordinator broker paths were converted to thin RPC proxies.
This eliminates multiple implementations of the same traversal/lookup,
reducing divergence and simplifying responsibility boundaries.

- Why this does NOT introduce data loss or regressions: snapshot
create/drop use explicit two‑phase semantics (PENDING → COMMIT/DELETING)
with SnapshotWriter writing manifests and metadata before commit; GC
uses snapshotRefIndex guards and
IsRefIndexLoaded/GetSnapshotBySegment/GetSnapshotByIndex checks to avoid
removing referenced files; restore flow pre‑allocates job IDs, validates
resources (partitions/indexes), performs rollback on failure
(rollbackRestoreSnapshot), and converts/updates segment/index metadata
only after successful copy tasks. Extensive unit and integration tests
exercise pending/deleting/GC/restore/error paths to ensure idempotence
and protection against premature deletion.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2026-01-06 10:15:24 +08:00
congqixia 6c8e11da4f
feat: [GoSDK] add QueryIterator support for Go client (#46633)
Related to #31293

Implement QueryIterator for the Go SDK to enable efficient iteration
over large query result sets using PK-based pagination.

Key changes:
- Add QueryIterator interface and implementation with PK-based
pagination
- Support Int64 and VarChar primary key types for pagination filtering
- Add QueryIteratorOption with batchSize, limit, filter, outputFields
config
- Fix ResultSet.Slice to handle Query results without IDs/Scores
- Add comprehensive unit tests and integration tests

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
- Core invariant: the iterator requires the collection primary key (PK)
to be present in outputFields so PK-based pagination and accurate row
counting work. The constructor enforces this by appending the PK to
outputFields when absent, and all pagination (lastPK tracking, PK-range
filters) and ResultCount calculations depend on that guaranteed PK
column.

- New capability: adds a public QueryIterator API (Client.QueryIterator,
QueryIterator interface, QueryIteratorOption) that issues server-side
Query RPCs in configurable batches and implements PK-based pagination
supporting Int64 and VarChar PKs, with options for batchSize, limit,
filter, outputFields and an upfront first-batch validation to fail fast
on invalid params.

- Removed/simplified logic: ResultSet.Slice no longer assumes IDs and
Scores are always present — it branches on presence of IDs (use IDs
length when non-nil; otherwise derive row count from Fields[0]) and
guards Scores slicing. This eliminates redundant/unsafe assumptions and
centralizes correct row-count logic based on actual returned fields.

- No data loss or behavior regression: pagination composes the user
filter with a PK-range filter and always requests the PK field, so
lastPK is extracted from a real column and fetchNextBatch only advances
when rows are returned; EOF is returned only when the server returns no
rows or iterator limit is reached. ResultSet.Slice guards prevent panics
for queries that lack IDs/Scores; Query RPC → ResultSet.Fields remains
the authoritative path for row data, so rows are not dropped and
existing query behavior is preserved.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-12-27 01:43:20 +08:00
marcelo-cjl 3b599441fd
feat: Add nullable vector support for proxy and querynode (#46305)
related: #45993 

This commit extends nullable vector support to the proxy layer,
querynode,
and adds comprehensive validation, search reduce, and field data
handling
    for nullable vectors with sparse storage.
    
    Proxy layer changes:
- Update validate_util.go checkAligned() with getExpectedVectorRows()
helper
      to validate nullable vector field alignment using valid data count
- Update checkFloatVectorFieldData/checkSparseFloatVectorFieldData for
      nullable vector validation with proper row count expectations
- Add FieldDataIdxComputer in typeutil/schema.go for logical-to-physical
      index translation during search reduce operations
- Update search_reduce_util.go reduceSearchResultData to use
idxComputers
      for correct field data indexing with nullable vectors
- Update task.go, task_query.go, task_upsert.go for nullable vector
handling
    - Update msg_pack.go with nullable vector field data processing
    
    QueryNode layer changes:
    - Update segments/result.go for nullable vector result handling
- Update segments/search_reduce.go with nullable vector offset
translation
    
    Storage and index changes:
- Update data_codec.go and utils.go for nullable vector serialization
- Update indexcgowrapper/dataset.go and index.go for nullable vector
indexing
    
    Utility changes:
- Add FieldDataIdxComputer struct with Compute() method for efficient
      logical-to-physical index mapping across multiple field data
- Update EstimateEntitySize() and AppendFieldData() with fieldIdxs
parameter
    - Update funcutil.go with nullable vector support functions

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Full support for nullable vector fields (float, binary, float16,
bfloat16, int8, sparse) across ingest, storage, indexing, search and
retrieval; logical↔physical offset mapping preserves row semantics.
  * Client: compaction control and compaction-state APIs.

* **Bug Fixes**
* Improved validation for adding vector fields (nullable + dimension
checks) and corrected search/query behavior for nullable vectors.

* **Chores**
  * Persisted validity maps with indexes and on-disk formats.

* **Tests**
  * Extensive new and updated end-to-end nullable-vector tests.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: marcelo-cjl <marcelo.chen@zilliz.com>
2025-12-24 10:13:19 +08:00
yihao.dai 889505872a
enhance: Return FlushAllMsg in response (#46347)
issue: https://github.com/milvus-io/milvus/issues/45919

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-12-16 10:35:16 +08:00
sijie-ni-0214 f51de1a8ab
feat: support TruncateCollection api to clear collection data (#46167)
issue: https://github.com/milvus-io/milvus/issues/46166

---------

Signed-off-by: sijie-ni-0214 <sijie.ni@zilliz.com>
2025-12-12 10:31:14 +08:00
yihao.dai f32f2694bc
enhance: Implement new FlushAllMessage and refactor flush all (#45920)
This PR:
1. Define and implement the new FlushAllMessage.
2. Refactor FlushAll to flush the entire cluster.

issue: https://github.com/milvus-io/milvus/issues/45919

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-12-10 19:27:13 +08:00
liliu-z 3f063a29b0
feat: Support Search By PK (#45820)
issue: #39157

Overview:
Support search by PK by resolving IDs to vectors on Proxy side. Upgrade
go-api to adapt to new proto definitions.

Design:
- Upgrade milvus-proto/go-api to latest master.
- Implement handleIfSearchByPK in Proxy: resolve IDs to vectors via
internal Query, then rewrite SearchRequest.
- Adapt to 'SearchInput' oneof field in SearchRequest across client and
handlers.
- Fix binary vector stride calculation bug in placeholder utils.

Compatibility:
- Old Pymilvus can still work w/o this feature

What is included:
- Dense and Sparse
- Multi vector fields
- Rejection on BM25

What is **not** include:
- Hybrid Search
- EmbeddingList
- Restful API

Signed-off-by: Li Liu <li.liu@zilliz.com>
2025-12-10 10:59:14 +08:00
congqixia 0171511d42
enhance: Bump go version to 1.24.11 fixing CVE (#46034)
Related to CVE-2025-61729

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-12-03 16:11:11 +08:00
congqixia fbfbd3bce2
enhance: Bump golang.org/x/crypto fixing CVE (#45975)
Related to #45976

Bump golang.org/x/crypto to v0.45.0 fixing CVE-2025-47914

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-12-01 20:57:10 +08:00
junjiejiangjjj d3164e8030
feat: add configurable batch factor and runtime check bypass for embedding functions (#45592)
https://github.com/milvus-io/milvus/issues/45544
- Add batch_factor configuration parameter (default: 5) to control
embedding provider batch sizes
- Add disable_func_runtime_check property to bypass function validation
during collection creation
- Add database interceptor support for AddCollectionFunction,
AlterCollectionFunction, and DropCollectionFunction requests

Signed-off-by: junjie.jiang <junjie.jiang@zilliz.com>
2025-11-20 19:55:04 +08:00
Amit Kumar 388d56fdc7
enhance: Add support for minimum_should_match in text_match (parser, engine, client, and tests) (#44988)
### Is there an existing issue for this?

- [x] I have searched the existing issues

---

Please see: https://github.com/milvus-io/milvus/issues/44593 for the
background

This PR makes https://github.com/milvus-io/milvus/pull/44638 redundant,
which can be closed. The PR comments for the original implementation
suggested an alternative and a better approach, this new PR has that
implementation.

---

This PR

- Adds an optional `minimum_should_match` argument to `text_match(...)`
and wires it through the parser, planner/visitor, index bindings, and
client-level tests/examples so full-text queries can require a minimum
number of tokens to match.

Motivation
- Provide a way to require an expression to match a minimum number of
tokens in lexical search.

What changed
- Parser / grammar
- Added grammar rule and token: `MINIMUM_SHOULD_MATCH` and
`textMatchOption` in `internal/parser/planparserv2/Plan.g4`.
- Regenerated parser outputs: `internal/parser/planparserv2/generated/*`
(parser, lexer, visitor, etc.) to support the new rule.
- Planner / visitor
- `parser_visitor.go`: parse and validate the `minimum_should_match`
integer; propagate as an extra value on the `TextMatch` expression so
downstream components receive it.
  - Added `VisitTextMatchOption` visitor method handling.
- Client (Golang)
- Added a unit test to verify `text_match(...,
minimum_should_match=...)` appears in the generated DSL and is accepted
by client code: `client/milvusclient/read_test.go` (new test coverage).
- Added an integration-style test for the feature to the go-client
testcase suite: `tests/go_client/testcases/full_text_search_test.go`
(exercise min=1, min=3, large min).
- Added an example demonstrating `text_match` usage:
`client/milvusclient/read_example_test.go` (example name conforms to
godoc mapping).
- Engine / index
  - Updated C++ index interface: `TextMatchIndex::MatchQuery`
- Added/updated unit tests for the index behavior:
`internal/core/src/index/TextMatchIndexTest.cpp`.
- Tantivy binding 
- Added `match_query_with_minimum` implementation and unit tests to
`internal/core/thirdparty/tantivy/tantivy-binding/src/index_reader_text.rs`
that construct boolean queries with minimum required clauses.



Behavioral / compatibility notes
- This adds an optional argument to `text_match` only; default behavior
(no `minimum_should_match`) is unchanged.
- Internal API change: `TextMatchIndex::MatchQuery` signature changed
(internal component). Callers in the repo were updated accordingly.
- Parser changes required regenerating ANTLR outputs 

Tests and verification
- New/updated tests:
- Go client unit test: `client/milvusclient/read_test.go` (mocked Search
request asserts DSL contains `minimum_should_match=2`).
- Go e2e-style test:
`tests/go_client/testcases/full_text_search_test.go` (exercises min=1, 3
and a large min).
- C++ unit tests for index behavior:
`internal/core/src/index/TextMatchIndexTest.cpp`.
  - Rust binding unit tests for `match_query_with_minimum`.
- Local verification commands to run:
- Go client tests: `cd client && go test ./milvusclient -run ^$` (client
package)
- Go testcases: `cd tests/go_client && go test ./testcases -run
TestTextMatchMinimumShouldMatch` (requires a running Milvus instance)
- C++ unit tests / build: run core build/test per repo instructions (the
change touches core index code).
- Rust binding tests: `cd
internal/core/thirdparty/tantivy/tantivy-binding && cargo test` (if
developing locally).

---------

Signed-off-by: Amit Kumar <amit.kumar@reddit.com>
Co-authored-by: Amit Kumar <amit.kumar@reddit.com>
2025-11-07 16:07:11 +08:00
congqixia 4a6e8d822c
enhance: Bump go version to 1.24.9 (#45359)
Fixing CVE-2025-58187

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-11-07 10:13:35 +08:00
congqixia 1e48911825
enhance: [GoSDK] Support struct array field type (#45291)
Related to #42148

Add comprehensive support for struct array field type in the Go SDK,
including data structure definitions, column operations, schema
construction, and full test coverage.

**Struct Array Column Implementation (`client/column/struct.go`)**
- Add `columnStructArray` type to handle struct array fields
- Implement `Column` interface methods:
- `NewColumnStructArray()`: Create new struct array column from
sub-fields
  - `Name()`, `Type()`: Basic metadata accessors
  - `Slice()`: Support slicing across all sub-fields
  - `FieldData()`: Convert to protobuf `StructArrayField` format
  - `Get()`: Retrieve struct values as `map[string]any`
  - `ValidateNullable()`, `CompactNullableValues()`: Nullable support
- Placeholder implementations for unsupported operations (AppendValue,
GetAsX, IsNull, AppendNull)

**Struct Array Parsing (`client/column/columns.go`)**
- Add `parseStructArrayData()` function to parse `StructArrayField` from
protobuf
- Update `FieldDataColumn()` to detect and parse struct array fields
- Support range-based slicing for struct array data

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-11-05 15:43:33 +08:00
yihao.dai cebe923d4a
enhance: Make GetReplicateInfo API work at the pchannel level (#44809)
issue: https://github.com/milvus-io/milvus/issues/44123

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-10-14 15:12:00 +08:00
congqixia faaf215913
enhance: Bump go version & builder image tag (#44757)
Bump go version to 1.24.6 fixing CVE-2025-47907

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-11 13:49:57 +08:00
congqixia e55e63288e
enhance: [GoSDK] bump pkg dep to v2.6.3 (#44619)
See also #31293 

Bump pkg dependency version to v2.6.2

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-09 19:43:57 +08:00
congqixia 1185fbec0a
enhance: Bump milvus & proto version to v2.6.3 (#44633)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-09-30 17:33:49 +08:00
congqixia bd6eb43617
fix: [GoSDK] Handle row->column input dynamic column (#44626)
Related to #44161

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-09-30 16:23:52 +08:00
cai.zhang 19346fa389
feat: Geospatial Data Type and GIS Function support for milvus (#44547)
issue: #43427

This pr's main goal is merge #37417 to milvus 2.5 without conflicts.

# Main Goals

1. Create and describe collections with geospatial type
2. Insert geospatial data into the insert binlog
3. Load segments containing geospatial data into memory
4. Enable query and search can display  geospatial data
5. Support using GIS funtions like ST_EQUALS in query
6. Support R-Tree index for geometry type

# Solution

1. **Add Type**: Modify the Milvus core by adding a Geospatial type in
both the C++ and Go code layers, defining the Geospatial data structure
and the corresponding interfaces.
2. **Dependency Libraries**: Introduce necessary geospatial data
processing libraries. In the C++ source code, use Conan package
management to include the GDAL library. In the Go source code, add the
go-geom library to the go.mod file.
3. **Protocol Interface**: Revise the Milvus protocol to provide
mechanisms for Geospatial message serialization and deserialization.
4. **Data Pipeline**: Facilitate interaction between the client and
proxy using the WKT format for geospatial data. The proxy will convert
all data into WKB format for downstream processing, providing column
data interfaces, segment encapsulation, segment loading, payload
writing, and cache block management.
5. **Query Operators**: Implement simple display and support for filter
queries. Initially, focus on filtering based on spatial relationships
for a single column of geospatial literal values, providing parsing and
execution for query expressions.Now only support brutal search
7. **Client Modification**: Enable the client to handle user input for
geospatial data and facilitate end-to-end testing.Check the modification
in pymilvus.

---------

Signed-off-by: Yinwei Li <yinwei.li@zilliz.com>
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
Co-authored-by: ZhuXi <150327960+Yinwei-Yu@users.noreply.github.com>
2025-09-28 19:43:05 +08:00
Bingyi Sun 2bd377af24
enhance: [go-sdk]allow users to insert pk data if autoid is enabled (#44561)
issue: #44424

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2025-09-28 14:27:04 +08:00
Chun Han 1b7562a766
feat: support mannual compact l0(#44439) (#44440)
related: #44439

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
2025-09-23 12:44:07 +08:00
wei liu 92d2fb6360
enhance: Add granular flush targets support for FlushAll operation (#44234)
issue: #44156
Enhance FlushAll functionality to support targeting specific collections
within databases instead of only database-level flushing.

Changes include:

- Add FlushAllTarget message in data_coord.proto for granular targeting
- Support collection-specific flush operations within databases
- Maintain backward compatibility with deprecated db_name field

This enhancement allows users to flush specific collections without
affecting other collections in the same database, providing more precise
control over data persistence operations.

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-09-19 18:38:01 +08:00
congqixia c142974853
enhance: Bump milvus & proto version to v2.6.2 (#44427)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-09-17 21:12:01 +08:00
yihao.dai 51f69f32d0
feat: Add CDC support (#44124)
This PR implements a new CDC service for Milvus 2.6, providing log-based
cross-cluster replication.

issue: https://github.com/milvus-io/milvus/issues/44123

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: chyezh <chyezh@outlook.com>
Co-authored-by: chyezh <chyezh@outlook.com>
2025-09-16 16:32:01 +08:00
congqixia 555132c834
enhance: [GoSDK] Add reciever parse result cache (#44166)
Related to #44161

This PR:
- Add reciever parse result cache
- Fix for nil IDs unmarshal panicking (#42895)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
Co-authored-by: wangcanjia <phpip@qq.com>
2025-09-02 16:33:52 +08:00
congqixia 4376876f90
enhance: Bump milvus & proto version to v2.6.1 (#44133)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-08-29 17:29:51 +08:00
congqixia d3fa305785
enhance: Add grpc metadata header for client request time (#44059)
Related to #44058

This PR:
- Add common grpc metadata key for client request time
- Add gosdk & milvus inteceptor related logic for this attribute
- Bump go sdk version

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-08-27 14:27:49 +08:00
Tianx c0d62268ac
feat: add timesatmptz data type (#44005)
issue: https://github.com/milvus-io/milvus/issues/27467
>
https://github.com/milvus-io/milvus/issues/27467#issuecomment-3092211420
> * [x]  M1 Create collection with timestamptz field
> * [x]  M2 Insert timestamptz field data
> * [x]  M3 Retrieve timestamptz field data
> * [x]  M4 Implement handoff[ ]  

The second PR of issue:
https://github.com/milvus-io/milvus/issues/27467, which completes M1-M4
described above.

---------

Signed-off-by: xtx <xtianx@smail.nju.edu.cn>
2025-08-26 15:59:53 +08:00
congqixia 56e40f7993
enhance: [GoSDK] Support IvfRabitQ & MinHashLSH index (#43975)
Related to #41746

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-08-22 04:55:47 +08:00
Tianx 26c5c779bf
feat: temporarily disable Timestamptz collection creation (#43935)
issue: https://github.com/milvus-io/milvus/issues/27467

Signed-off-by: xtx <xtianx@smail.nju.edu.cn>
2025-08-21 11:17:46 +08:00
zhuwenxing 71dc135289
test: add rerank function testcases in go client (#43891)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-08-19 14:57:48 +08:00
wei liu d3c95eaa77
enhance: Support partial field updates with upsert API (#42877)
issue: #29735
Implement partial field update functionality for upsert operations,
supporting scalar, vector, and dynamic JSON fields without requiring all
collection fields.

Changes:
- Add queryPreExecute to retrieve existing records before upsert
- Implement UpdateFieldData function for merging data
- Add IDsChecker utility for efficient primary key lookups
- Fix JSON data creation in tests using proper map marshaling
- Add test cases for partial updates of different field types

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-08-19 11:15:45 +08:00
Xianhui Lin b98b3b16a3
feat:add BatchDescribeCollection interface (#43786)
feat:add BatchDescribeCollection interface
issue: https://github.com/milvus-io/milvus/issues/43781

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
2025-08-18 01:23:45 +08:00