Skip to content

Conversation

@weiliu1031
Copy link
Contributor

Summary

  • Add CMEK compatibility validation for snapshot restore operations
  • Ensure encryption zone matching between source snapshot and target database
  • Fix schema.DbName not being set correctly during restore

Changes

  • Add validateCMEKCompatibility function to enforce encryption rules:
    • Non-encrypted snapshots can only restore to non-encrypted databases
    • Encrypted snapshots can only restore to databases with matching ezID
  • Add DescribeDatabase broker method to retrieve target database properties
  • Fix schema.DbName not being set in RestoreCollection
  • Fix DbName field missing in convertModelToDesc response

Test plan

  • Unit tests added for all CMEK validation scenarios (8 test cases)
  • Unit test added for RestoreCollection schema handling

issue: #44358

issue: milvus-io#44358

- Add validateCMEKCompatibility to enforce encryption zone matching
  during snapshot restore:
  - Non-encrypted snapshots can only restore to non-encrypted databases
  - Encrypted snapshots can only restore to databases with matching ezID
- Add DescribeDatabase broker method to retrieve target database properties
- Fix schema.DbName not being set in RestoreCollection
- Fix DbName field missing in convertModelToDesc response

Signed-off-by: Wei Liu <[email protected]>
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sre-ci-robot sre-ci-robot added the size/XL Denotes a PR that changes 500-999 lines. label Jan 15, 2026
@mergify mergify bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Jan 15, 2026
@sre-ci-robot
Copy link
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm
  • /ci-rerun-e2e-default // for ci-v2/e2e-default

If you have any questions or requests, please contact @zhikunyao.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 58.06452% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.45%. Comparing base (2572770) to head (be69376).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
internal/datacoord/broker/coordinator_broker.go 0.00% 17 Missing ⚠️
internal/datacoord/snapshot_manager.go 79.54% 8 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (58.06%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (76.45%) is below the target coverage (77.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #47089      +/-   ##
==========================================
- Coverage   76.56%   76.45%   -0.12%     
==========================================
  Files        2016     2016              
  Lines      326928   326362     -566     
==========================================
- Hits       250316   249521     -795     
- Misses      68652    68836     +184     
- Partials     7960     8005      +45     
Components Coverage Δ
Client 75.68% <ø> (ø)
Core 82.95% <ø> (ø)
Go 74.79% <58.06%> (-0.17%) ⬇️
Files with missing lines Coverage Δ
internal/rootcoord/root_coord.go 77.42% <100.00%> (+<0.01%) ⬆️
internal/datacoord/snapshot_manager.go 52.52% <79.54%> (+9.41%) ⬆️
internal/datacoord/broker/coordinator_broker.go 92.01% <0.00%> (-7.99%) ⬇️

... and 47 files with indirect coverage changes

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

@mergify mergify bot added the ci-passed label Jan 15, 2026
Copy link
Contributor

@XuanYang-cn XuanYang-cn left a comment

Choose a reason for hiding this comment

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

/lgtm

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: weiliu1031, XuanYang-cn
To complete the pull request process, please assign congqixia after the PR has been reviewed.
You can assign the PR to them by writing /assign @congqixia in a comment when ready.

The full list of commands accepted by this bot can be found 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-passed dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement lgtm size/XL Denotes a PR that changes 500-999 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants