23345 Commits

Author SHA1 Message Date
Zhen Ye
9d29e6ee64
fix: append operation can be only canceled by the wal itself but not the rpc (#45078)
issue: #45077

We need to promise the state of wal consistent with the memory state of
streamingnode. So we don't allow the append operation can be cancelled
by the append caller to avoid leave a inconsistent state of alive wal.
The wal append operation can only be cancelled when the wal is shutting
down.

Signed-off-by: chyezh <chyezh@outlook.com>
2025-10-27 11:08:05 +08:00
yihao.dai
2631e7f42a
enhance: Close channel replicator more gracefully (#45029)
issue: https://github.com/milvus-io/milvus/issues/44123

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-10-27 11:00:06 +08:00
Spade A
ce2862d325
fix: fix parquet import bug in STRUCT (#45028)
issue: https://github.com/milvus-io/milvus/issues/45006
ref: https://github.com/milvus-io/milvus/issues/42148

Previsouly, the parquet import is implemented based on that the STRUCT
in the parquet files is hanlded in the way that each field in struct is
stored in a single column.
However, in the user's perspective, the array of STRUCT contains data is
something like STRUCT_A:
for one row, [struct{field1_1, field2_1, field3_1}, struct{field1_2,
field2_2, field3_2}, ...], rather than {[field1_1, field1_2, ...],
[field2_1, field2_2, ...], [field3_1, field3_2, field3_3, ...]}.

This PR fixes this.

---------

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-27 10:26:06 +08:00
congqixia
7c627260f3
enhance: Optimize ScalarIndexSort bitmap initialization for range queries (#45085)
Optimize bitmap initialization in ScalarIndexSort range queries by using
adaptive strategy based on result density. When more than 50% of
elements match the range condition, initialize bitmap with all true
values and clear non-matching elements. Otherwise, use the original
approach of initializing with false and setting matching elements. Also
defer bitmap allocation until after early return checks to avoid
unnecessary memory allocation.

This optimization reduces bit operations for high-selectivity queries
while maintaining the same performance for low-selectivity queries.

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-27 10:08:06 +08:00
Bingyi Sun
58277c8eb0
feat: Auto add namespace field data if namespace is enabled (#44933)
issue: #44011

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2025-10-24 18:40:05 +08:00
cai.zhang
b069eeecd2
fix: Added GetMetrics back to IndexNodeServer to ensure compatibility (#45073)
issue: #45070

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
2025-10-24 17:00:06 +08:00
tinswzy
c328fd3c6a
fix: etcd request context contamination by RBAC auth info (#44964)
#44892 fix etcd request context contamination by RBAC auth info
```
When RBAC is enabled, Milvus uses the gRPC metadata library to inject RBAC authentication information into the request context (ctx).
Since etcd’s authentication mechanism also relies on the same metadata library, if the same ctx is passed down to the etcd request, the RBAC auth info from Milvus contaminates the auth information used by etcd.
This causes the etcd server to report an invalid auth token error when RBAC is enabled but etcd auth is disabled.
```

#43638 upgrade wp to v0.1.10

Signed-off-by: tinswzy <zhenyuan.wei@zilliz.com>
2025-10-24 15:38:05 +08:00
Buqian Zheng
c284e8c4a8
enhance: some minor code cleanup, prepare for scalar benchmark (#45008)
issue: https://github.com/milvus-io/milvus/issues/44452

---------

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
2025-10-24 14:22:05 +08:00
congqixia
199f6d936e
fix: Update milvus-storage to fix duplicate AWS SDK initialization (#45062)
Update milvus-storage version from aa189ad to e5f5b4c to include the fix
for duplicate AWS SDK initialization that was causing init conflicts.

This update removes the redundant arrow::fs::InitializeS3() call that
was resulting in duplicate Aws::InitAPI() initialization. The duplicate
initialization was causing AWS SDK to ignore custom configurations,
particularly affecting GCP Workload Identity authentication.

Changes in milvus-storage e5f5b4c:
- Remove redundant arrow::fs::InitializeS3() call
- Keep only the extended S3 initialization with custom AWS SDK options
- Ensure GCP IAM authentication via custom HTTP client factory works
correctly

Relates to #44745
Reference: milvus-io/milvus-storage#285

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-24 11:32:05 +08:00
zhuwenxing
1e130683be
test: add geometry datatype in checker (#44794)
/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-10-24 11:28:04 +08:00
Spade A
17ab2ac622
fix: fix alter collection failed for STRUCT sub-fields (#45041)
issue: https://github.com/milvus-io/milvus/issues/45001
ref: https://github.com/milvus-io/milvus/issues/42148

---------

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-24 10:24:06 +08:00
Spade A
d8591f9548
fix: csv/json import with STRUCT adapts concatenated struct name (#45000)
After https://github.com/milvus-io/milvus/pull/44557, the field name in
STRUCT field becomes STRUCT_NAME[FIELD_NAME]
This PR make import consider the change.

issue: https://github.com/milvus-io/milvus/issues/45006
ref: https://github.com/milvus-io/milvus/issues/42148

TODO: parquet is much more complex than csv/json, and I will leave it to
a separate PR.

---------

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-24 10:22:15 +08:00
Spade A
6494c75d31
fix: collection level MMAP does not take effect for STRUCT (#44996)
issue: https://github.com/milvus-io/milvus/issues/42148

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-23 19:52:05 +08:00
Feilong Hou
7aa56e1fb6
test: change test_milvus_client_search_json_path_index_all_expressions to L1 (#44986)
Issue: #44989 
On branch feature/json-shredding
Changes to be committed:
modified: milvus_client/test_milvus_client_query.py

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
2025-10-23 16:14:05 +08:00
Buqian Zheng
22995cea3f
fix: Remove debug logging from JsonFlatIndex (#44807)
issue: https://github.com/milvus-io/milvus/issues/44452

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
Co-authored-by: buqian.zheng <buqian.zheng@zilliz.com>
2025-10-23 16:08:06 +08:00
Bingyi Sun
52270701ce
feat: use namespace skip index when search (#44888)
issue: #44011

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
2025-10-23 12:04:04 +08:00
Spade A
6077178553
enhance: enable STL_SORT to support VARCHAR (#44401)
issue: https://github.com/milvus-io/milvus/issues/44399

This PR implements STL_SORT for VARCHAR data type for both RAM and MMAP
mode.
The general idea is that we deduplicate field values and maintains a
posting list for each unique value.

The serialization format of the index is:
```
[unique_count][string_offsets][string_data][post_list_offsets][post_list_data][magic_code]
string_offsets: array of offsets into string_data section
string_data: str_len1, str1, str_len2, str2, ...
post_list_offsets: array of offsets into post_list_data section
post_list_data: post_list_len1, row_id1, row_id2, ..., post_list_len2, row_id1, row_id2, ...
```

---------

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-23 11:00:05 +08:00
aoiasd
cfeb095ad7
enhance: forbid build analyzer at proxy (#44067)
relate: https://github.com/milvus-io/milvus/issues/43687
We used to run the temporary analyzer and validate analyzer on the
proxy, but the proxy should not be a computation-heavy node. This PR
move all analyzer calculations to the streaming node.

---------

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
2025-10-23 10:58:12 +08:00
congqixia
20dcb45b3d
fix: prevent data race in querycoord collection notifier update (#45037)
Fixes #45035

This commit addresses a data race issue where refreshCollection was
updating the collection notifier without proper lock protection.

Changes:
- Add UpdateCollection method to CollectionManager with proper locking
- Introduce CollectionOperator pattern for thread-safe collection
updates
- Make setRefreshNotifier private and use it through the operator
pattern
- Update refreshCollection to use the new UpdateCollection method
- Handle collection not found error gracefully in refreshCollection

The CollectionOperator pattern ensures all collection modifications go
through the CollectionManager's lock, preventing concurrent access
issues.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-23 10:28:04 +08:00
Spade A
b6261f0282
fix: fix "at most one distinct index is allowed per field" in STRUCT index (#44969)
issue: https://github.com/milvus-io/milvus/issues/42148

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-22 19:50:04 +08:00
zhikunyao
cab9ee63f6
test: mergify removes ci-passed when only tests changes (#45038)
Signed-off-by: Zhikun Yao <zhikun.yao@zilliz.com>
2025-10-22 18:56:04 +08:00
congqixia
314ee81712
enhance: standardize mockery config for proxy package (#45030)
Related to #44761 #38339
This commit consolidates the proxy package's mockery generation to use a
centralized `.mockery.yaml` configuration file, aligning with the
pattern used by other packages like querycoordv2.

Changes
- **Makefile**: Replace multiple individual mockery commands with a
single config-based invocation for `generate-mockery-proxy` target
- **internal/proxy/.mockery.yaml**: Add mockery configuration defining
all mock interfaces for proxy and proxy/shardclient packages
- **Mock files**: Regenerate mocks using the new configuration:
- `mock_cache.go`: Clean up by removing unused interface methods
(credential, shard cache, policy methods)
- `shardclient/mock_lb_balancer.go`: Update type comments (nodeInfo →
NodeInfo)
  - `shardclient/mock_lb_policy.go`: Update formatting
- `shardclient/mock_shardclient_manager.go`: Fix parameter naming
consistency (nodeInfo1 → nodeInfo)
- **task_search_test.go**: Remove obsolete mock expectations for
deprecated cache methods

Benefits
- Centralized mockery configuration for easier maintenance
- Consistent with other packages (querycoordv2, etc.)
- Cleaner mock interfaces by removing unused methods
- Better type consistency in generated mocks

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-22 16:00:05 +08:00
Ted Xu
196006b4ce
enhance: update delta log serialization APIs to integrate storage V2 (#44998)
See #39173

In this PR:

- Adjusted the delta log serialization APIs.
- Refactored the stats collector to improve the collection and digest of
primary key and BM25 statistics.
- Introduced new tests for the delta log reader/writer and stats
collectors to ensure functionality and correctness.

---------

Signed-off-by: Ted Xu <ted.xu@zilliz.com>
2025-10-22 15:58:12 +08:00
congqixia
6c34386ff2
enhance: extract shard client logic into dedicated package (#45018)
Related to #44761

Refactor proxy shard client management by creating a new
internal/proxy/shardclient package. This improves code organization and
modularity by:

- Moving load balancing logic (LookAsideBalancer, RoundRobinBalancer) to
shardclient package
- Extracting shard client manager and related interfaces into separate
package
- Relocating shard leader management and client lifecycle code
- Adding package documentation (README.md, OWNERS)
- Updating proxy code to use the new shardclient package interfaces

This change makes the shard client functionality more maintainable and
better encapsulated, reducing coupling in the proxy layer.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-22 10:22:04 +08:00
yihao.dai
a0f6b31380
fix: Fix primary-secondary replication switch blocking (#44898)
1. Fix primary-secondary replication switchover blocking by delete
replicate pchannel meta using modRevision.
2. Stop channel replicator(scanner) when cluster role changes to prevent
continued message consumption and replication.
3. Close Milvus client to prevent goroutine leak.
4. Create Milvus client once for a channel replicator.
5. Simplify CDC controller and resources.

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

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-10-22 10:12:04 +08:00
cai.zhang
3d11ba06ef
fix: Double check to avoid iter has been earsed by other thread (#45013)
issue: #44974

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
2025-10-21 23:36:04 +08:00
Zhen Ye
2aa48bf4ca
fix: wrong execution order of DDL/DCL on secondary (#44886)
issue: #44697, #44696

- The DDL executing order of secondary keep same with order of control
channel timetick now.
- filtering the control channel operation on shard manager of
streamingnode to avoid wrong vchannel of create segment.
- fix that the immutable txn message lost replicate header.

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-10-21 22:38:05 +08:00
zhuwenxing
b497dd0b45
test: add geometry datatype testcases (#44646)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-10-21 19:56:03 +08:00
wei liu
9dddc380a4
fix: Handle empty FieldsData in reduce/rerank for requery scenario (#44917)
issue: #44909

When requery optimization is enabled, search results contain IDs
but empty FieldsData. During reduce/rerank operations, if the
first shard has empty FieldsData while others have data,
PrepareResultFieldData initializes an empty array, causing
AppendFieldData to panic when accessing array indices.

Changes:
- Find first non-empty FieldsData as template in 3 functions:
  reduceAdvanceGroupBy, reduceSearchResultDataWithGroupBy,
  reduceSearchResultDataNoGroupBy
- Add length check before 2 AppendFieldData calls in reduce
  functions to prevent panic
- Improve newRerankOutputs to find first non-empty fieldData
  using len(FieldsData) check instead of GetSizeOfIDs
- Add length check in appendResult before AppendFieldData
- Add comprehensive unit tests for empty and partial empty
  FieldsData scenarios in both reduce and rerank functions

This fix handles both pure requery (all empty) and mixed
scenarios (some empty, some with data) without breaking normal
search flow. The key improvement is checking FieldsData length
directly rather than IDs, as requery may have IDs but empty
FieldsData.

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-10-21 19:42:03 +08:00
zhagnlu
730308b1eb
fix: fix not equal not include None (#44959)
#44816

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
2025-10-21 17:08:03 +08:00
sre-ci-robot
cfae60093c
[automated] Bump milvus version to v2.6.4 (#45010)
Bump milvus version to v2.6.4
Signed-off-by: sre-ci-robot sre-ci-robot@users.noreply.github.com

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-21 16:50:04 +08:00
congqixia
8f16afd5e7
fix: Handle JSON field default values in storage layer (#44999)
Related to #44995
Added missing case for JSON data type in GetDefaultValue function to
properly retrieve default values for JSON fields. This prevents crashes
when enabling dynamic fields with default values during concurrent
insert operations.

Changes:
- Added JSON data type case in GetDefaultValue to return BytesData
- Added comprehensive tests for fillMissingFields covering JSON and
other data types with default values
- Added tests for nullable fields, required fields validation, and edge
cases

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-21 15:14:03 +08:00
sre-ci-robot
a4d584f22b
[automated] Bump milvus version to v2.6.4 (#45004)
Bump milvus version to v2.6.4
Signed-off-by: sre-ci-robot sre-ci-robot@users.noreply.github.com

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-21 15:08:03 +08:00
yihao.dai
0c61d969bb
fix: Fix Fix replication txn data loss during chaos (#44963)
Only confirm CommitMsg for txn messages to prevent data loss.

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

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-10-21 14:16:04 +08:00
Zhen Ye
21076196bf
enhance: support resource group with WAL-based DDL framework (#44874)
issue: #43897

- Resource group related DDL is implemented by WAL-based DDL framework
now.
- Support following message type in wal AlterResourceGroup,
DropResourceGroup.
- Resource group DDL can be synced by new CDC now.
- Refactor some UT for resource group DDL.

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-10-21 09:58:03 +08:00
cai.zhang
b23d75a032
fix: Fix bug for gis function to filter geometry (#44966)
issue: #44961 

This PR fixes 3 geometry related bugs:
1. Implement `ToString` interface for GisFunctionFilter.
2. Ignore GisFunctionFilter `MoveCursor` for growing segment.
3. Don't skip null geometry for building R-Tree index, should be record
in null_offsets.

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
2025-10-21 09:52:04 +08:00
cai.zhang
a35a3b7c69
fix: Ensure fulfill promise when CreateArrowFileSystem throw an exception (#44975)
issue: #44974

---------

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
2025-10-20 23:32:03 +08:00
sre-ci-robot
3545f6673f Update all contributors
Signed-off-by: sre-ci-robot <sre-ci-robot@zilliz.com>
2025-10-20 12:00:46 +00:00
congqixia
70a7ae2e39
fix: [skip e2e]use eventual assertion for pending message check in replicate stream test (#44972)
Related to #44620

The test was flaky because pendingMessages.Len() assertion happened
before async message processing completed. Changed to assert.Eventually
to wait up to 1 second for the pending queue to drain, fixing the race
condition where actual was 1 but expected was 0.

Fixes TestReplicateStreamClient_Reconnect flakiness.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-10-20 19:32:03 +08:00
Yiqing Lu
ccc963279e
fix: update bitnami repo (#44955)
This pull request updates dependencies for Milvus deployments, focusing
on the images used for etcd and Kafka in both Helm and Docker Compose
configurations. The main goal is to align the deployment with newer or
organization-specific images for improved compatibility and maintenance.

**Helm deployment image updates:**

* Switched the etcd image repository from `bitnami/etcd` to
`milvusdb/etcd` and updated the etcd image tag from
`3.5.0-debian-10-r24` to `3.5.5-r2` in both standalone and cluster Helm
installation commands in `DeployTest.groovy`.

**Docker Compose image updates:**

* Changed the Kafka image from `bitnami/kafka:3.1.0` to
`bitnamilegacy/kafka:3.1.0` in `docker-compose.yml`.

issue: #44978

Signed-off-by: AlintaLu <yiqing.lu@zilliz.com>
2025-10-20 18:58:09 +08:00
zhuwenxing
2f4b66d9ab
test: add struct array testcases (#44940)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-10-20 17:34:03 +08:00
nico
a4935d2eaa
test: update rba test cases 2 (#44954)
Signed-off-by: nico <cheng.yuan@zilliz.com>
2025-10-20 16:32:03 +08:00
aoiasd
ac82bad0b3
enhance: optimize idf oracle sync logic (#44628)
Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
2025-10-20 15:42:08 +08:00
Zhen Ye
a3a28a4b99
fix: rerank before requery if reranker didn't use field data (#44942)
issue: #44918

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-10-20 14:26:02 +08:00
zhagnlu
05df48fbe4
fix:remove duplicated '/' in jsonstats path (#44939)
#44950

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
2025-10-20 14:06:03 +08:00
Spade A
34f54da155
fix: reject GEOMETRY and TIMESTAMPTZ in STRUCT (#44937)
issue: https://github.com/milvus-io/milvus/issues/44930

Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
2025-10-20 11:32:05 +08:00
zhikunyao
c2ed2cfc39
test: support e2e on arm (#44880)
Signed-off-by: Zhikun Yao <zhikun.yao@zilliz.com>
2025-10-20 10:44:03 +08:00
Zhen Ye
f98d02b3e1
fix: use short debug string to avoid newline in debug logs (#44925)
issue: #44924

Signed-off-by: chyezh <chyezh@outlook.com>
2025-10-20 10:16:03 +08:00
Feilong Hou
16ff5db79d
test: Add e2e case for timestamptz (currently skipping them) (#44871)
Issue: #44518

On branch feature/timestamps
Changes to be committed:
    modified: common/common_func.py
    new file: milvus_client/test_milvus_client_timestamptz.py

---------

Signed-off-by: Eric Hou <eric.hou@zilliz.com>
Co-authored-by: Eric Hou <eric.hou@zilliz.com>
2025-10-20 10:04:02 +08:00
yihao.dai
168dc49bfc
enhance: Disable import for replicating cluster (#44850)
1. Import in replicating cluster is not supported yet, so disable it for
now.
2. Remove GetReplicateConfiguration wal API

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

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2025-10-20 09:56:01 +08:00