100 Commits
Author SHA1 Message Date
bab1876d0b fix: [Storage] retry transient TiKV write transaction failures (#51426)
- Rebuild TiKV write transactions on retriable begin, build-stage IO,
and classified-transient commit failures while aborting deterministic
build failures and unsafe commit outcomes.
- Preserve original errors for TiKV undetermined commit results and
caller cancellation before string-wrapping; keep private
`retry.Unrecoverable` markers inside the retry helper so they never leak
to callers.
- Stop `ReliableWriteMetaKv` from replaying undetermined TiKV write
results, correct the TiKV begin/requestTimeout comment, and add
regression tests for commit aborts, retry exhaustion, deadline stopping,
and outer reliable-write behavior.

related: #51425

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 11:18:41 +08:00
sthuangandGitHub 6c7300f15c fix: avoid repeated grantee scans in ListPolicy (#51404)
Related: #50236

- Reuse the initially loaded grantee keys/values when ListPolicy checks
legacy grantee ID ownership.
- Avoid reloading the full grantee-privileges tree once per legacy
grant.
- Add a regression test that verifies ListPolicy performs only one full
grantee-prefix load for legacy grants.

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-07-16 17:40:37 +08:00
444050550d enhance: [Catalog] split metastore catalog interfaces (#50946)
- Split the metastore catalog interfaces into coordinator-specific files
so follow-up coordinator refactors can move their catalog surfaces
independently.
- Preserve the existing interfaces, signatures, and behavior; the rework
only fixes gci import grouping in the split RootCoord and StreamingNode
catalog files.

related: #50917

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 11:40:33 +08:00
sthuangandGitHub a6568ac24e enhance: [RBAC] support for /expr endpoint (#47062)
related: #46442

This commit adds proper RBAC (Role-Based Access Control) support for the
/expr HTTP endpoint, replacing the previous root-only authentication.

Changes:
- Add new rbac.go with CheckPrivilege function for HTTP endpoints
- Support HTTP Basic Auth only (removed non-standard Bearer token
format)
- Integrate with existing Casbin RBAC framework
- Add PrivilegeExpr to GlobalLevelPrivileges and ClusterAdminPrivileges
- Register GetUserRoleFunc callback in meta_cache.go
- Update tests for new RBAC behavior

Security features:
- Authentication required when authorization is enabled
- Root user bypass when RootShouldBindRole is false
- Proper 401/403 status code differentiation
- Integration with privilege result cache

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-22 21:58:26 +08:00
sthuangandGitHub c5cc4dedd5 fix: [Proxy] validate AlterCollection description only when changed (#50532)
PR #50178 added an unconditional collection-description length check in
proxy `alterCollectionTask.PreExecute`. The check runs on every incoming
`collection.description` value, including values that are not actually
changing.

### Bug

A collection created before the limit existed (e.g. a 2 KB description)
gets rejected when a client resends that unchanged description alongside
a genuine change (e.g. a TTL update). Proxy fails it with
`ErrParameterInvalid`, even though the description is not being
modified. This breaks the PR's own invariant: existing collection
metadata is not re-validated.

### Change

Validate the description only when its value actually differs from the
stored one. A pre-existing collection can resend its (possibly
oversized) description unchanged while altering other properties; that
unchanged value is now skipped. A new or genuinely changed oversized
description still returns `ErrParameterInvalid`.

This keeps the check in `alterCollectionTask.PreExecute`, the same layer
as every other AlterCollection property validator (TTL, mmap,
consistency level), so the fix stays minimal and consistent with the
surrounding code.

## Tests

`internal/proxy/task_test.go` —
`TestAlterCollectionTaskValidateDescription` rewritten as table cases:
- resending an unchanged oversized description while altering TTL is
accepted (the bug);
- changing a valid description to an oversized one is rejected;
- changing an oversized description to a different oversized value is
rejected;
- shrinking an oversized description to a valid value is accepted;
- with duplicate description keys, a changed oversized value is still
rejected per-property.

related: #50173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-16 12:02:22 +08:00
sthuangandGitHub dad363e42e fix: [RBAC] describe_user returns ghost empty role names after repeated grant/revoke (#50058)
- Skip malformed RBAC catalog entries whose parsed etcd key segments are
empty or whitespace-only when listing roles, user-role mappings, grants,
and policies, so describe_user no longer surfaces ghost empty role names
from historical trailing-slash keys.
- Keep the fix read-side only and inline with the existing invalid-key
handling; write, replay, restore, and cleanup paths remain unchanged.
- Add regression coverage for empty-segment RBAC keys across
describe-user role lookup, ListRole, ListUserRole, ListGrant, and
ListPolicy.

related: #49989

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-15 19:42:21 +08:00
sthuangandGitHub ce5d6b5088 enhance: [RBAC] support role descriptions (#50184)
- Persist role descriptions when creating roles, expose them in role
list/describe results, and support updating descriptions through the
AlterRole path without changing role names.
- Store role descriptions in the role value body while keeping role
names in keys, and tolerate legacy empty role values plus undecodable
stored values by returning an empty description for that role row.
- Reject built-in/default roles and over-limit descriptions before WAL
writes, and share the role-description length validator between proxy
and rootcoord.

related: #50183

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-15 14:22:23 +08:00
sthuangandGitHub 5d80a9fd81 feat: [RBAC] support user description in credentials (#50186)
- Wire credential descriptions through create/update/read paths,
including proxy, HTTP v2, Go SDK options, length validation, optional
update presence handling, and internal credential proto/model
persistence.
- Preserve existing encrypted passwords and descriptions during
RootCoord credential updates when either field is omitted, reject
all-empty or partial direct password updates, and keep sha256 passwords
cache-only.
- Skip auth-cache refresh for description-only credential updates so
existing authentication state is not blanked, while still refreshing
caches for password updates.
- Return persisted user descriptions from select_user and HTTP v2
describe_user, including include_role_info=false, and reuse
already-loaded credential rows in user listing and RBAC backup to avoid
duplicate etcd reads while ignoring malformed credential keys.
- Use the upstream milvus-proto go-api/v3 version that includes the
credential description proto change; the temporary fork replaces in
root, pkg, client, and tests/go_client modules have been removed.

design doc:
docs/design-docs/design_docs/20260601-rbac-user-description.md

related: #50179

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-15 00:44:22 +08:00
sthuangandGitHub 0308c3de40 enhance: [Proxy] enforce collection description byte limit (#50178)
- Add a refreshable proxy.maxCollectionDescriptionLength setting with a
default 1024-byte limit and document it in milvus.yaml.
- Validate collection descriptions during CreateCollection and
AlterCollection PreExecute, including duplicate alter properties, while
leaving existing metadata loading unchanged.
- Document that restore or replication flows that recreate collections
through CreateCollection must satisfy the configured limit or raise it
first.
- Cover byte-length boundaries, CJK byte overflow, create rejection,
alter rejection, refreshability, duplicate alter-property rejection, and
generated YAML consistency in tests.

related: #50173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-12 10:32:21 +08:00
sthuangandGitHub 3d932f1c3e fix: [RBAC] use full-length grantee ID hash (#50060)
- Add a dedicated RBAC grantee ID helper that keeps the full 32-hex MD5
digest while preserving the legacy `MD5` helper for existing callers.
- Switch grantee-id write paths and collection-name grant migration to
full-length IDs, and use dual-format lookup so upgraded clusters can
still read unique legacy 16-hex metadata.
- Harden legacy grantee-id ownership checks so shared legacy IDs fail
closed on reads and lazy migration, unique legacy child keys are cleaned
up during migration, and drop/rename cleanup does not copy or remove
shared child subtrees while survivor parent keys still reference them.
- Cover the upgrade path with tests for legacy list/grant/revoke
behavior, shared-ID read/migration/drop/rename safety, computed-MD5
orphan exclusion, and full-length collision resistance.

related: #49857

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-06-02 12:18:16 +08:00
sthuangandGitHub dcda428d54 fix: hit meta cache for collection aliases (#49513)
related: https://github.com/milvus-io/milvus/issues/49510

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-05-06 22:38:11 +08:00
sthuangandGitHub 5030ae2520 fix: stop shipping built-in privilege groups in yaml to elimi… (#49201)
…ate drift

Built-in RBAC privilege groups were shipping both in
pkg/util/constant.go Go
arrays and in configs/milvus.yaml. Whenever a new privilege was added to
the
Go arrays, the yaml was frequently forgotten; stale yaml then overrode
the fresh Go defaults at
  runtime, returning PERMISSION_DENIED on built-in group roles.

  This change flips Export=false on the 9 privilege group ParamItems so
generated milvus.yaml no longer ships them as defaults. Runtime falls
through
to DefaultValue (Go constants). Deployments that need to override still
work
unchanged — FileSource still wins over DefaultValue when the user sets
the
  key in their own yaml.

Also removes the deprecated
common.security.rbac.overrideBuiltInPrivilegeGroups.enabled
  flag (zero production references).

issue: #49167

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-04-23 22:33:45 +08:00
sthuangandGitHub 1e34e8e203 enhance: add default etcd auth credentials and startup validation (#48598)
related: #48587

Provide default userName/password (etcdadmin) for etcd authentication
and add fail-fast validation that panics with a clear message when
etcd.auth.enabled=true but credentials are empty, instead of failing
with an opaque etcd connection error.

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-04-17 13:13:42 +08:00
sthuangandGitHub 4e8483c55d fix: [RBAC] preserve wildcard privilege in RBAC backup/restore (#48978)
- Catalog.RestoreRBAC routed IsAnyWord through the
IsPrivilegeNameDefined /else branches and ended up calling
PrivilegeGroupNameForMetastore("*"), writing
'grantee-id/<id>/PrivilegeGroup*'.
- MetaTable.CheckIfRBACRestorable rejected wildcard grants with
'privilege [*] does not exist' before broadcastRestoreRBACV2 ever
reached the catalog, so the catalog fix alone was unreachable on the
in-process restore path.

related: #48963

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-04-14 19:43:41 +08:00
sthuangandGitHub 80db722759 enhance: Improve balance system with type-safe interface, shared helper, and dead code cleanup (#48372)
related: https://github.com/milvus-io/milvus/issues/48373

- Add missing `return` in `GetSegmentTaskNum` for early exit when no
filters
- Rename `SetAssignedScore` to `AddAssignedScore` to match `+=`
semantics
- Remove deprecated `rand.Seed` init (Go 1.20+ auto-seeds)
- Add `ScoreAwareAssignPolicy` interface to eliminate type assertions
- Extract `BalanceReplicaHelper` to deduplicate streaming service checks
across balancers
- Remove unused `meta` field from RoundRobin/RowCount/ScoreBased
balancer structs

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-04-10 02:23:40 +08:00
sthuangandGitHub c54f2e47a1 fix: split QueryCoord executor into channel/non-channel pools to prev… (#48309)
…ent deadlock

related: #48308 

When hundreds of channels need rebalancing (e.g. during upgrade),
channel tasks could fill the entire per-node executor pool, blocking
segment/leader tasks and causing a deadlock. This fix splits the single
pool into two independent pools:
- Channel task pool: controlled by channelTaskCapFraction (default 0.1)
- Non-channel task pool: remainder of total capacity

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-03-19 14:05:27 +08:00
3cd435d6ac fix: [RBAC] grant cleanup on drop and migration on rename and meta cache interceptor (#48140)
related: #48061
related: #48062
related: #48137 

- Reconstruct logical etcd keys to avoid double rootPath prefix in
  delete/migrate operations
- Use typeutil.After for privilege name extraction instead of broken
   length-based substring
- Match wildcard dbName  and use DefaultTenant consistently
- Move grant cleanup to DropCollection ack callback
- Enable resolveAliasForPrivilege by default and fix alias cache
- passed rbac alias e2e tests

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Signed-off-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Li Liu <li.liu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 10:13:24 +08:00
sthuangandGitHub f5b6db2929 fix: resolve collection alias in RBAC and clean up grants on collection lifecycle (#47851)
related: https://github.com/milvus-io/milvus/issues/47850
1. Privilege interceptor: resolve collection alias to real collection
name
   before RBAC permission check, so that operating via alias checks
   permission against the real collection, not the alias name.

2. MetaCache alias cache: add aliasInfo cache with positive/negative
   entries to avoid repeated DescribeAlias RPC calls. Cache is
invalidated on alias removal, collection removal, and database removal.

3. Catalog grant cleanup: add DeleteGrantByCollectionName and
   MigrateGrantCollectionName to RootCoordCatalog interface and kv
   implementation. On collection drop, delete all associated grants;
   on collection rename, migrate grants to the new name.

4. Feature flag: add proxy.resolveAliasForPrivilege config to
   enable/disable alias resolution in the privilege interceptor.

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-03-05 18:39:22 +08:00
sthuangandGitHub be8e8a274d feat: add storage version label to DataCoordNumSegments metric (#46929)
related: https://github.com/milvus-io/milvus/issues/46928

Add segment_storage_version label to track segment counts by storage
version (V1=0, V2=2). This enables monitoring segment distribution
across different storage formats.

Changes:
- Add segmentStorageVersionLabelName constant in metrics.go
- Update DataCoordNumSegments GaugeVec with new label
- Update segMetricMutation struct to track storage version dimension
- Update all WithLabelValues calls in meta.go
- Add unit tests for the new label

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-01-12 19:53:27 +08:00
sthuangandGitHub 7bcd3b1061 enhance: add security controls for /expr endpoin (#46753)
related: https://github.com/milvus-io/milvus/issues/46442

core changes:
- Add  config (default: false) to disable /expr endpoint by default
- On Proxy nodes, require root user authentication via HTTP Basic Auth
when enabled
- On non-Proxy nodes, keep original auth parameter behavior for backward
compatibility
- Add HasRegistered() and AuthBypass to expr package for node type
detection

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2026-01-12 11:11:27 +08:00
sthuangandGitHub edd250ffef fix: [StorageV2] force virtual host for oss and cos (#44484)
related: #44481

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-09-22 16:58:11 +08:00
sthuangandGitHub 2f70a73258 fix: turn on azure by default (#44377)
related: #44354, #44138, #43869

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-09-17 10:12:01 +08:00
sthuangandGitHub 0ec47a50ba enhance: clean up vcpkg build (#44386)
related: #44385

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-09-16 10:21:59 +08:00
sthuangandGitHub b38013352d enhance: [StorageV2] enable build with azure (#44177)
related: #43869

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-09-14 08:05:58 +08:00
sthuangandGitHub 9140201b8f fix: add init fs check for querynode and streaming node (#44360)
related: #44354

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-09-13 10:31:58 +08:00
sthuangandGitHub dfc2335144 enhance: [StorageV2] storage file system error messages (#44255)
related: https://github.com/milvus-io/milvus/issues/44138

bump milvus storage version, include the followings:
* https://github.com/milvus-io/milvus-storage/pull/243
* https://github.com/milvus-io/milvus-storage/pull/240
* https://github.com/milvus-io/milvus-storage/pull/245

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-09-09 19:37:56 +08:00
sthuangandGitHub fc03fe7623 enhance: avoid frequent LoadWithPrefix etcd calls in ShowCollections … (#43902)
related: https://github.com/milvus-io/milvus/issues/43901

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-08-18 14:57:44 +08:00
sthuangandGitHub 5e4eb4a6e0 enhance: [StorageV2] bump storage version (#43871)
related: https://github.com/milvus-io/milvus/issues/43869

bump storage version. include the following feature:
* https://github.com/milvus-io/milvus-storage/pull/231
* https://github.com/milvus-io/milvus-storage/pull/232
* https://github.com/milvus-io/milvus-storage/pull/233

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-08-15 17:59:43 +08:00
sthuangandGitHub c102fa8b0b enhance: [StorageV2] zero copy for packed writer record batch (#43779)
The Out of Memory (OOM) error occurs because a handler retains the
entire ImportRecordBatch in memory. Consequently, even when child arrays
within the batch are flushed, the memory for the complete batch is not
released. We temporarily fixed by deep copying record batch in #43724.

The proposed fix is to split the RecordBatch into smaller sub-batches by
column group. These sub-batches will be transferred via CGO, then
reassembled before being written to storage using the Storage V2 API.
Thus we can achieve zero-copy and only transferring references in CGO.

related: #43310

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-08-15 10:11:44 +08:00
sthuangandGitHub e66a2cb4dd fix: skip binlog v2 milvus tools build (#43701)
related: #43648, #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-08-04 16:03:38 +08:00
sthuangandGitHub df02014b3b enhance: [rbac] privilege groups add import and add field privileges (#43664)
related: https://github.com/milvus-io/milvus/issues/29367,
https://github.com/milvus-io/milvus/pull/42687

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-31 20:47:36 +08:00
43c3c160ff feat: [StorageV2] cmd binlog tool (#43648)
related: #39173 

Core Features
* Parquet File Analysis: Analyze Milvus binlog Parquet files with
metadata extraction
* MinIO Integration: Direct connection to MinIO storage for remote file
analysis
* Vector Data Deserialization: Specialized handling of Milvus vector
data in binlog files
* Interactive CLI: Command-line interface with interactive exploration

Analysis Capabilities
* Metadata & Vector Analysis: Extract schema info, row counts, and
vector statistics
* Data Export: Export data to JSON format with configurable limits
* Query Functionality: Search for specific records by ID
* Batch Processing: Analyze multiple Parquet files simultaneously

User Experience
* Verbose Output: Detailed logging for debugging
* Error Handling: Robust error handling for file access and parsing
* Flexible Output: Support for single file and batch analysis formats

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Co-authored-by: nico <109071306+NicoYuan1986@users.noreply.github.com>
2025-07-31 15:05:37 +08:00
sthuangandGitHub a2c7ed2780 fix: [StorageV2] sort field binlogs paths for packed reader and writer (#43585)
key changes:
* fix unstable storage v2 compaction unit test by guaranteeing the order
of paths during sync.
* bump milvus-storage version, include
https://github.com/milvus-io/milvus-storage/pull/222
https://github.com/milvus-io/milvus-storage/pull/223
https://github.com/milvus-io/milvus-storage/pull/224
https://github.com/milvus-io/milvus-storage/pull/225
https://github.com/milvus-io/milvus-storage/pull/226
* Also fix the below related oom issue.
related: https://github.com/milvus-io/milvus/issues/43310

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-30 08:09:36 +08:00
sthuangandGitHub 5cebc9f7f6 fix: [StorageV2] handle correct cid with multiple files and add storage v2 prefix logs (#43539)
related: #43372

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-25 11:22:54 +08:00
sthuangandGitHub a0c9f499ee fix: [StorageV2] sync panic with nullable add field (#43142)
related: https://github.com/milvus-io/milvus/pull/42932
fix: https://github.com/milvus-io/milvus/issues/43072

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-25 10:08:53 +08:00
sthuangandGitHub 59bbdd93f5 fix: [StorageV2] fill the correct group chunk into cell (#43486)
The root cause of the issue lies in the fact that when a sealed segment
contains multiple row groups, the get_cells function may receive
unordered cids. This can result in row groups being written into
incorrect cells during data retrieval.

Previously, this issue was hard to reproduce because the old Storage V2
writer had a bug that caused it to write row groups larger than 1MB.
These large row groups could lead to uncontrolled memory usage and
eventually an OOM (Out of Memory) error. Additionally, compaction
typically produced a single large row group, which avoided the incorrect
cell-filling issue during query execution.

related: https://github.com/milvus-io/milvus/issues/43388,
https://github.com/milvus-io/milvus/issues/43372,
https://github.com/milvus-io/milvus/issues/43464, #43446, #43453

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-22 22:22:53 +08:00
sthuangandGitHub f77571d5c1 fix: [StorageV2] file writer write row group split to default size (#43471)
Bumped milvus storage version.
related: https://github.com/milvus-io/milvus/issues/43310

* https://github.com/milvus-io/milvus-storage/pull/213
* https://github.com/milvus-io/milvus-storage/pull/217
* https://github.com/milvus-io/milvus-storage/pull/220

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-22 09:52:52 +08:00
sthuangandGitHub 6c5f5f1e32 enhance: [StorageV2] refactor group chunk translator (#43406)
related: #43372

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-21 19:46:53 +08:00
sthuangandGitHub 4f17640598 enhance: [StorageV2] clean up legacy flag (#43290)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-15 10:18:49 +08:00
sthuangandGitHub a0ae5bccc9 fix: [StorageV2] load growing segment get dim datatype check (#43168)
related: https://github.com/milvus-io/milvus/issues/43072

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-07 15:46:47 +08:00
sthuangandGitHub 276c52490d fix: [StorageV2] missing arrow fs when building index (#43162)
fix: https://github.com/milvus-io/milvus/issues/43150,
https://github.com/milvus-io/milvus/issues/43149

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-07 15:26:46 +08:00
sthuangandGitHub 9f361a228e enhance: storage v2 chunked column memory size from meta (#43130)
use meta to get chunked column memory size to avoid getting cells
actually from storage.
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-07-07 14:24:46 +08:00
sthuangandGitHub 238bd30f42 fix: [StorageV2] end to end minor issues for sync, stats, and load (#42948)
Fix issues in end-to-end tests: 
1. **Split column groups based on schema**, rather than estimating by
average chunk row size. **Ensure column group consistency within a
segment**, to avoid errors caused by loading multiple column group
chunks simultaneously.
2. **Use sorted segmentId** when generating the stats binlog path, to
ensure consistent and correct file path resolution.
3. **Determine field IDs as follows**:
For multi-column column groups, retrieve the field ID list from
metadata.
For single-column column groups, use the column group ID directly as the
field ID.

related: #39173 
fix: #42862

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-27 14:44:42 +08:00
sthuangandGitHub 0d57acb13a enhance: [StorageV2] field id as meta path for wide column when load (#42863)
related: #42862 #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-25 11:08:48 +08:00
sthuangandGitHub d4260b47fa fix: [StorageV2] sync panic with add field (#42932)
related: #39663

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-25 10:08:40 +08:00
sthuangandGitHub ad6d620e9f fix: [StorageV2] Compiling debug mode throw DCHECK s3 initialize error (#42922)
related: https://github.com/milvus-io/milvus/issues/42844

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-24 19:30:41 +08:00
sthuangandGitHub 4a0a2441f2 enhance: [StorageV2] field id as meta path for wide column (#42787)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-19 15:00:38 +08:00
sthuangandGitHub ed5dbf3eaa enhance: [StorageV2] sync separate vector datatype into its own column group (#42638)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-16 11:48:37 +08:00
sthuangandGitHub 9439eaef52 fix: [StorageV2] sync with int8 vector data type core dumped (#42616)
related: https://github.com/milvus-io/milvus/issues/42613, #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-10 11:42:35 +08:00
sthuangandGitHub 89c3afb12e fix: [StorageV2] index/stats task level storage v2 fs (#42191)
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-10 11:06:35 +08:00
sthuangandGitHub b136f85ca0 fix: storage v2 write mmap file per field per cell (#42180)
Each cell of a field should be written to its own mmap file, rather than
writing all cells of the field into a single mmap file.
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-09 11:48:33 +08:00
sthuangandGitHub 490827974d enhance: avoid shutdown sdk api in minio cm destructor (#42459)
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-06-04 09:58:39 +08:00
sthuangandGitHub b9b554676c fix: storage v2 get field data with correct column group files (#42107)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-05-27 15:26:28 +08:00
sthuangandGitHub e9442f575d feat: storage v2 seal segment load (#41567)
storage v2 chunked seal segment loading is based on caching layer. A
cell unit in storage v2 is a parquet row group in remote object storage,
containing all fields. Therefore, each field needs a proxy to do related
one field operations.

<img width="965" alt="Screenshot 2025-04-28 at 10 59 30"
src="https://github.com/user-attachments/assets/83e93a10-3b1d-4066-ac17-b996d5650416"
/>

related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-30 14:22:58 +08:00
sthuangandGitHub 6c377b6e86 feat: Storage v2 index and stats raw data (#41534)
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-30 08:48:54 +08:00
sthuangandGitHub e46e3a1708 enhance: optimize error log message for list policy (#41251)
related: #41250

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-16 17:16:32 +08:00
sthuangandGitHub 1f1c836fb9 feat: Storage v2 growing segment load (#41001)
support parallel loading sealed and growing segments with storage v2
format by async reading row groups.
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-16 17:14:33 +08:00
sthuangandGitHub 0d45b24599 fix: show collections support custom privilege groups granted objects (#41203)
related: https://github.com/milvus-io/milvus/issues/41200

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-10 12:12:25 +08:00
sthuangandGitHub 50e02e3598 enhance: update packed reader api (#41055)
related: https://github.com/milvus-io/milvus/issues/39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-09 10:18:26 +08:00
sthuangandGitHub a85e36bad2 fix: create collection task check failed after restart (#40982)
The fields and partitions information are stored and fetched with
different prefixes in the metadata. In the CreateCollectionTask, the
RootCoord checks the existing collection information against the
metadata. This check fails if the order of the fields or partitions info
differs, leading to an error after restarting Milvus. To resolve this,
we should use a map in the check logic to ensure consistency.

related: https://github.com/milvus-io/milvus/issues/40955

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-04-05 06:58:22 +08:00
sthuangandGitHub d7df78a6c9 feat: Storage v2 compaction (#40667)
- Feat: Support Mix compaction. Covering tests include compatibility and
rollback ability.
  - Read v1 segments and compact with v2 format.
  - Read both v1 and v2 segments and compact with v2 format.
  - Read v2 segments and compact with v2 format.
  - Compact with duplicate primary key test.
  - Compact with bm25 segments.
  - Compact with merge sort segments.
  - Compact with no expiration segments.
  - Compact with lack binlog segments.
  - Compact with nullable field segments.
- Feat: Support Clustering compaction. Covering tests include
compatibility and rollback ability.
  - Read v1 segments and compact with v2 format.
  - Read both v1 and v2 segments and compact with v2 format.
  - Read v2 segments and compact with v2 format.
  - Compact bm25 segments with v2 format.
  - Compact with memory limit.
- Enhance: Use serdeMap serialize in BuildRecord function to support all
Milvus data types.
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-21 10:16:12 +08:00
sthuangandGitHub c0e03b6ca4 fix: rbac star privilege return empty when listing policy (#40553)
related: https://github.com/milvus-io/milvus/issues/40547

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-12 14:16:05 +08:00
sthuangandGitHub e0ec1aceeb fix: skip storage v2 unstable ut for now (#40378)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-05 20:30:39 +08:00
sthuangandGitHub 63a7c4570e feat: storage v2 sync (#39663)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-05 11:22:15 +08:00
sthuangandGitHub a6396ddda5 enhance: storage v2 clang format version 12 (#40287)
change storage v2 clang-format version from 14 to 12 to match with
Milvus.
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-04 21:52:40 +08:00
sthuangandGitHub d77756cf2d fix: fix storage v2 cgo mem leak (#40305)
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-04 14:16:00 +08:00
sthuangandGitHub de02a3ebcc feat: Storage v2 binlog packed record reader and writer (#40221)
related: #39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-03-03 10:24:02 +08:00
sthuangandGitHub 90acc8a58f enhance: upgrade go arrow version from 12.0.1 to 17.0.0 (#39916)
related: https://github.com/milvus-io/milvus/issues/39915

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-02-25 10:30:02 +08:00
sthuangandGitHub 3eb3af5f08 feat: explicitly specify column groups for storage v2 api (#39790)
* use the new packed reader and writer api to be compatible with current
etcd meta
* For the new packed writer API: column groups and paths are explicitly
defined by users and won't split column groups by memory in storage v2.
Packed writer follows the user-defined column groups to split arrow
record and write into the corresponding file path.
* For the new packed reader API: read paths are explicitly defined by
users.
related: #39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-02-21 22:03:54 +08:00
sthuangandGitHub f47320e0e7 enhance: clean up legacy storage v2 (#39987)
related: https://github.com/milvus-io/milvus/issues/39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-02-19 15:42:52 +08:00
sthuangandGitHub 15c8798b93 feat: storage v2 serde reader and writer (#39667)
related: https://github.com/milvus-io/milvus/issues/39173

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-02-11 16:00:46 +08:00
sthuangandGitHub 5f4bad6b23 fix: metastore privilege name check with privilege name all (#39476)
related: https://github.com/milvus-io/milvus/issues/39365

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-01-26 12:17:20 +08:00
sthuangandGitHub c4ae9f4ece feat: introduce third-party milvus-storage (#39418)
related: https://github.com/milvus-io/milvus/issues/39173

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-01-24 17:21:13 +08:00
sthuangandGitHub 3c9f26942d enhance: clean up logs of empty op key (#39335)
related: https://github.com/milvus-io/milvus/issues/39334

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-01-17 10:29:03 +08:00
sthuangandGitHub 5c5948cb70 fix: rbac custom group privilege level check (#39164)
related: https://github.com/milvus-io/milvus/issues/39086

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-01-13 11:24:59 +08:00
sthuangandGitHub 3cd74037db fix: restore rbac with empty meta panic (#39141)
related: https://github.com/milvus-io/milvus/issues/38985

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2025-01-13 10:02:57 +08:00
sthuangandGitHub 94955e5292 fix: expand privilege group when list policy in rootcoord (#38758)
related: https://github.com/milvus-io/milvus/issues/38757

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-26 15:38:50 +08:00
sthuangandGitHub 6bc799061e fix: fix privilege group list and list collections (#38684)
related: #37031
* built-in privilege group privileges in listPrivilegeGroups() should be
the same as in milvus.yaml
* collections granted by collection level built-in privilege group
should be list in showCollections()

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-25 18:00:51 +08:00
sthuangandGitHub de8858931a fix: rbac revoke check if there is same privilege in other privilege groups granted (#38558)
related: https://github.com/milvus-io/milvus/issues/38557

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-18 18:46:45 +08:00
sthuangandGitHub b9d8c5c1d7 fix: privilege group privileges granted from ClusterAdmin permission denied (#38514)
related: https://github.com/milvus-io/milvus/issues/38460

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-17 17:34:44 +08:00
sthuangandGitHub c2855a5c74 enhance: add privilege group privilege into built-in privilege group (#38393)
related issue: https://github.com/milvus-io/milvus/issues/37031

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-12 17:20:42 +08:00
sthuangandGitHub a65d395ecd fix: grant v2 collection name and privilege error typo (#38195)
issue: https://github.com/milvus-io/milvus/issues/38042

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-04 16:14:38 +08:00
sthuangandGitHub d822edb9a8 enhance: add list aliases privilege into public role (#38176)
related issue: https://github.com/milvus-io/milvus/issues/37031

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-03 23:42:39 +08:00
sthuangandGitHub 6f1b1ad78b enhance: [GoSDK] add operate privilege & privilege group API (#38141)
related issue: https://github.com/milvus-io/milvus/issues/37031

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-03 18:32:40 +08:00
sthuangandGitHub a5e0a56a8e fix: move grant/revoke v2 params check from rootcoord to proxy (#38130)
related issue: https://github.com/milvus-io/milvus/issues/37031

fixed issues #38042: The interface "grant_v2" does not support empty
collectionName while the error says it does

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-02 19:48:37 +08:00
sthuangandGitHub 23dc313c44 fix: fix grant/revoke v2 meta and unclear error messages (#38110)
related issue: https://github.com/milvus-io/milvus/issues/37031

fixed issues:
#37974: better error messages for grant v2 interface
#37903: fix meta built-in privilege group object name
#37843: better error messages for custom privilege group interface 
#38002: fix built-in privilege group meta to pass proxy interceptor
check
#38008: fix revoke v2 to support revoking v1 granted privileges

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-12-02 11:36:39 +08:00
sthuangandGitHub bd0811434b fix: fix grant v2 service (#37945)
issue: https://github.com/milvus-io/milvus/issues/37031

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-11-22 19:42:32 +08:00
sthuangandGitHub 19572f5b06 enhance: RBAC new grant/revoke privilege (#37785)
issue: https://github.com/milvus-io/milvus/issues/37031
also fix issues: https://github.com/milvus-io/milvus/issues/37843,
https://github.com/milvus-io/milvus/issues/37842,
https://github.com/milvus-io/milvus/issues/37887

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-11-21 22:20:34 +08:00
sthuangandGitHub 2d72ad33f2 enhance: RBAC built in privilege groups (#37720)
issue: #37031

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-11-18 20:38:39 +08:00
sthuangandGitHub ff00a12805 enhance: RBAC custom privilege group ut coverage (#37558)
issue: https://github.com/milvus-io/milvus/issues/37031

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-11-09 20:40:25 +08:00
sthuangandGitHub 70605cf5b3 enhance: Support custom privilege group for RBAC (#37087)
issue: #37031

---------

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-11-09 08:44:28 +08:00
sthuangandGitHub 4493aa2142 fix: querycoord collection num metric (#36471)
related to: #36456

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-09-26 14:23:13 +08:00
sthuangandGitHub d8668fe405 enhance: upgrade go version to 1.21.11 (#35257)
issue: #35142

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-08-05 16:12:15 +08:00
shaoting-huangandGitHub 88b373b024 enhance: binlog primary key turn off dict encoding (#34358)
issue: #34357 

Go Parquet uses dictionary encoding by default, and it will fall back to
plain encoding if the dictionary size exceeds the dictionary size page
limit. Users can specify custom fallback encoding by using
`parquet.WithEncoding(ENCODING_METHOD)` in writer properties. However,
Go Parquet [fallbacks to plain
encoding](https://github.com/apache/arrow/blob/e65c1e295d82c7076df484089a63fa3ba2bd55d1/go/parquet/file/column_writer_types.gen.go.tmpl#L238)
rather than custom encoding method users provide. Therefore, this patch
only turns off dictionary encoding for the primary key.

With a 5 million auto ID primary key benchmark, the parquet file size
improves from 13.93 MB to 8.36 MB when dictionary encoding is turned
off, reducing primary key storage space by 40%.

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-07-17 17:47:44 +08:00
shaoting-huangandGitHub f4dd7c7efb enhance: add delta log stream new format reader and writer (#34116)
issue: #34123

Benchmark case: The benchmark run the go benchmark function
`BenchmarkDeltalogFormat` which is put in the Files changed. It tests
the performance of serializing and deserializing from two different data
formats under a 10 million delete log dataset.

Metrics: The benchmarks measure the average time taken per operation
(ns/op), memory allocated per operation (MB/op), and the number of
memory allocations per operation (allocs/op).
| Test Name | Avg Time (ns/op) | Time Comparison | Memory Allocation
(MB/op) | Memory Comparison | Allocation Count (allocs/op) | Allocation
Comparison |

|---------------------------------|------------------|-----------------|---------------------------|-------------------|------------------------------|------------------------|
| one_string_format_reader | 2,781,990,000 | Baseline | 2,422 | Baseline
| 20,336,539 | Baseline |
| pk_ts_separate_format_reader | 480,682,639 | -82.72% | 1,765 | -27.14%
| 20,396,958 | +0.30% |
| one_string_format_writer | 5,483,436,041 | Baseline | 13,900 |
Baseline | 70,057,473 | Baseline |
| pk_and_ts_separate_format_writer| 798,591,584 | -85.43% | 2,178 |
-84.34% | 30,270,488 | -56.78% |

Both read and write operations show significant improvements in both
speed and memory allocation.

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-07-06 09:08:09 +08:00
shaoting-huangandGitHub 5f02e52561 enhance: Refactor data codec deserialize (#33923)
#33922

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-06-20 11:17:59 +08:00
shaoting-huangandGitHub eb3197eb1e enhance: update amazonlinux2023 image builder (#33948)
#32982

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-06-19 16:44:01 +08:00
shaoting-huangandGitHub 8cdc0e6233 fix: fix data codec writer close (#33818)
issue:#33813

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-06-18 13:59:57 +08:00
shaoting-huangandGitHub 0ecd694305 enhance: legacy code clean up (#33838)
issue: #33839

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-06-14 14:25:56 +08:00
shaoting-huangandGitHub 3c7d0209d4 enhance: update checker for go version (#33351)
Signed-off-by: shaoting-huang [shaoting-huang@zilliz.com]

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

Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
2024-05-24 14:23:40 +08:00