Skip to content

feat: support gzip compression for gRPC messages - #646

Merged
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
xiaofan-luan:feat/grpc-zstd
Nov 28, 2026
Merged

sre-ci-robot merged 1 commit into
milvus-io:masterfrom
xiaofan-luan:feat/grpc-zstd

Conversation

@xiaofan-luan

@xiaofan-luan xiaofan-luan commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Change

Enable gzip for outgoing gRPC messages with ConnectParam::WithCompression(milvus::GrpcCompression::GZIP). Connections default to NONE. The SDK uses the standard gRPC dependency, and copies of the connection parameters retain the selection. The peer selects the response encoding.

DEFLATE is unsupported by this SDK option. Milvus v3.0.6 standalone has no deflate decompressor and returns gRPC UNIMPLEMENTED for a deflate-encoded Connect.

Verification

  • Built the stock gRPC 1.65.0 Release SDK on macOS arm64 and used it from a separately compiled consumer. All 1,025 native unit tests and all 35 tests in the affected V2 integration file passed.
  • The transport integration test verifies that a peer with gzip disabled serves the default connection and rejects explicit gzip with UNIMPLEMENTED.
  • A read-only interoperability run against the official milvusdb/milvus:v3.0.6 image verified the gzip path, including compressed request and response frames on HasCollection.

SDK compression design

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xiaofan-luan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T09:39:58.300792Z d17e448 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.47%. Comparing base (a0592aa) to head (160ecb5).
⚠️ Report is 187 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #646       +/-   ##
===========================================
+ Coverage   53.47%   89.47%   +36.00%     
===========================================
  Files          52      451      +399     
  Lines        4432    18980    +14548     
  Branches        0     2114     +2114     
===========================================
+ Hits         2370    16983    +14613     
+ Misses       2062     1994       -68     
- Partials        0        3        +3     
Files with missing lines Coverage Δ
src/impl/MilvusConnection.cpp 89.83% <100.00%> (+29.68%) ⬆️
src/impl/types/ConnectParam.cpp 100.00% <100.00%> (+27.71%) ⬆️
src/include/milvus/types/ConnectParam.h 100.00% <ø> (ø)

... and 465 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/impl/MilvusConnection.cpp Resolved
Comment thread src/impl/MilvusConnection.cpp Resolved
Comment thread CMakeLists.txt Resolved
Comment thread scripts/export_grpc_zstd.py Resolved
Comment thread conanfile.py Resolved
@xiaofan-luan xiaofan-luan changed the title feat: support zstd compression for gRPC messages feat: support gzip and deflate compression for gRPC messages Nov 27, 2026
Comment thread test/it/v2/TestUtility.cpp Resolved
Comment thread test/it/v2/TestUtility.cpp Resolved

@yhmo yhmo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all six changed files. The implementation is sound: channel-level default compression via ChannelArguments::SetCompressionAlgorithm, an ABI-preserving layout change (TLS flag kept in bit 0 of the single transport_flags_ byte so older binaries writing 0/1 still read NONE), and the swap to = default copy-assignment is equivalent to the removed custom one. Both V1 and V2 clients share MilvusConnection, and compression survives database-switch / credential-reset reconnects because the stored ConnectParam copy carries it.

Two low-severity, non-blocking notes were left inline on the new mocked test in test/it/v2/TestUtility.cpp: a positive-path coverage gap and the test's coupling to gRPC's internal error-message text. No correctness, safety, or merge-blocking issues found.

@xiaofan-luan xiaofan-luan changed the title feat: support gzip and deflate compression for gRPC messages feat: support gzip compression for gRPC messages Nov 27, 2026
Comment thread src/impl/types/ConnectParam.cpp Resolved
Comment thread src/include/milvus/types/ConnectParam.h Resolved
Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
Comment thread test/it/v2/TestUtility.cpp Resolved
@mergify mergify Bot added the ci-passed label Nov 28, 2026
@yhmo yhmo added the lgtm label Nov 28, 2026
@sre-ci-robot
sre-ci-robot merged commit 828e6c8 into milvus-io:master Nov 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants