Files
milvus/CLAUDE.md
T
dd6a411e5e doc: add design docs directory (#49829)
issue: #49831

## What changed

Vendor Milvus design documents into this repository under
`docs/design-docs` as regular tracked files.

- Keep only the design document content and assets under
`docs/design-docs/design_docs/` and `docs/design-docs/assets/`.
- Remove standalone repository metadata from the vendored directory,
such as `README.md`, `CONTRIBUTING.md`, `MEP-TEMPLATE.md`, `COMMITTERS`,
`MAINTAINERS`, `OWNERS`, `OWNERS_ALIASES`, and `.gitignore`.
- Document the Milvus design document process in the main
`CONTRIBUTING.md`.
- Update Mergify and `tools/mgit.py` so feature PRs must provide an
in-repo design document path under `docs/design-docs/design_docs/`.

## Why

Milvus feature work should have an associated design document. Keeping
design docs directly in this repository makes them available from a
normal Milvus checkout and lets feature implementations include or link
the related design document in the same repository.

## Verification

- `git diff --check`
- `python3 -m unittest tools/test_mgit_design_doc.py`
- `python3 -m py_compile tools/mgit.py tools/test_mgit_design_doc.py`
- Parsed `.github/mergify.yml` with Python `yaml.safe_load`
- Confirmed `docs/design-docs` only contains `assets/` and
`design_docs/` at the top level

---------

Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 18:56:24 +08:00

2.6 KiB

Milvus

Vector database. Go + C++ (internal/core/) + Rust (tantivy). pkg has its own go.mod (module: github.com/milvus-io/milvus/pkg/v3). Run go get from pkg/ when adding dependencies there, not from root.

Architecture

Coordinators manage metadata and scheduling; nodes execute work.

  • Coordinators: rootcoord, datacoord, querycoordv2 (note the v2 suffix in directory names)
  • Nodes: proxy (user-facing), querynodev2, datanode, streamingnode
  • All component interfaces defined in internal/types/types.go

Testing

Go tests MUST use -tags dynamic,test and -gcflags="all=-N -l" (disable optimizations/inlining) or they won't compile / mockey-based monkey patching will fail:

go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/querycoordv2/...
go test -tags dynamic,test -gcflags="all=-N -l" -count=1 ./internal/proxy/... -run TestXxx

Per-module shortcuts: make test-querycoord, make test-proxy, etc.

Run Milvus Locally

scripts/start_standalone.sh    # start standalone mode
scripts/start_cluster.sh       # start cluster mode
scripts/stop_graceful.sh       # stop
scripts/standalone_embed.sh    # embedded standalone (no external deps)

Code Conventions

  • Error handling: use merr package, not fmt.Errorf
  • Logging: use pkg/v2/log, not standard "log" or fmt.Println
  • Import order: standard → third-party → github.com/milvus-io (enforced by gci)
  • Config params: paramtable (pkg/v2/util/paramtable), config in configs/milvus.yaml

PR and Commit Conventions

PR title format: {type}: {description}. Valid types: feat:, fix:, enhance:, test:, doc:, auto:, build(deps):. PR body must be non-empty. Issue/doc linking rules:

  • fix: — must link issue (e.g. issue: #123)
  • feat: — must link issue + design doc under docs/design-docs
  • Every Milvus feature should have a related design doc under docs/design-docs; submit the doc in this repository and link it from the Milvus feature PR.
  • enhance: — must link issue if size L/XL/XXL
  • doc:, test: — no issue required
  • 2.x branch PRs must link the corresponding master PR (e.g. pr: #123)

DCO check is required. Always use -s so the developer's Signed-off-by is appended last:

git commit -s -m "commit message

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"

-s auto-appends Signed-off-by: <developer> at the end. The developer MUST be the final sign-off, not the AI.

Generated Files — Do Not Hand-Edit

  • Mock files (internal/mocks/*, mock_*.go): regenerate with make generate-mockery-{module}
  • Proto files (pkg/proto/*.pb.go): regenerate with make generated-proto-without-cpp