fix: support explicit db_name in snapshot APIs for cross-database operations#3295
fix: support explicit db_name in snapshot APIs for cross-database operations#3295zhuwenxing wants to merge 1 commit intomilvus-io:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zhuwenxing The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
…s-database operations Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
9c7b6bf to
d226f92
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3295 +/- ##
=======================================
Coverage 76.79% 76.79%
=======================================
Files 63 63
Lines 13236 13236
=======================================
Hits 10164 10164
Misses 3072 3072 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/assign @weiliu1031 |
|
I think two db_names might not work in Milvus, the API in pymilvus is explicitly designed to omit db_name to reduce the complexity, that all(at least majority) API doesn't need db_name. |
|
This is a good catch though, APIs are not aligned with each other on how to pass in db_name. For now, we tends to set the db_name in interceptors only. |
|
/hold |
|
snapshot will be bind with collection_name and the API will be redesigned soon. Let's make db_name in PyMIlvus consists with other APIs. |
Summary
db_nameparameter to 4 snapshot APIs (create_snapshot,list_snapshots,restore_snapshot,list_restore_snapshot_jobs) across all layers (Prepare, GrpcHandler, AsyncGrpcHandler, MilvusClient, AsyncMilvusClient)db_nameis now populated in the protobuf request body, enabling cross-database snapshot operations (e.g., restore a snapshot fromdb_aintodb_b)db_nameis sent via both proto body and metadata headerWhy both proto body and metadata?
db_namedb_nameparameter (cross-db operations)dbname(viaCallContext)db_name, falls back to client'sself._db_nameviaDatabaseInterceptorAffected APIs
db_namein proto bodycreate_snapshotlist_snapshotsrestore_snapshotlist_restore_snapshot_jobsExample: cross-database restore
Test plan
338bac3), covering:create_snapshotwith explicitdb_namefrom default-db clientlist_snapshotsper database withdb_namefilterdb_a→db_b,db_a→db_c(empty db)db_b→db_bdb_name(uses client's db via metadata)