...
Code Block |
---|
func (mt *metaTable) GetCollectionByName(collectionName string, ts typeutil.Timestamp) (*pb.CollectionInfo, error) { mt.ddLock.RLock() defer mt.ddLock.RUnlock() if ts == 0 { vid, ok := mt.collName2ID[collectionName] if !ok { // NEW **if vid, ok = mt.collAlias2ID[collectionName]; !ok {** return nil, fmt.Errorf("can't find collection: " + collectionName) } } ... } |
...
For persistence in etcd
, the key will be fmt.Sprintf("%s/%s", CollectionAliasMetaPrefix, CollectionAlias)
and the value be CollectionID
.
Changes to the RootCoordinator
Code Block |
---|
// root_coord.proto
service RootCoord {
|
...
// NEW |
...
// CreateAlias creates 1 to 1 mapping between `alias` and `collection_name` // 1. If there no `alias` in the metaTable: // 1.1 new `alias` will be added to the metaTable // 1.2 `alias` will be persisted in the `etcd` // 1.3 `dd_op` will sent to log broker. // 2. If there is `alias/collection` in the metaTable: // 2.1 An `alias/collection already exists` error will be returned. rpc CreateAlias(milvus.CreateAliasRequest) returns (common.Status) {} |
...
// NEW |
...
// 1. DropAlias
// 1.1 Removes Mapping from metaTable
// 1.2 Removes Mapping from `etcd`
// 1.3 `dd_op` will be sent to log broker.
// 1.4 Invalidates proxy caches
rpc DropAlias(milvus.DropAliasRequest) returns (common.Status) {}
|
...
// NEW |
...
// 1. AlterAlias
// 1.1 Mapping will be updated in metaTable.
// 1.2 Mapping will be updated in `etcd`
// 1.3 `dd_op` will be sent to log broker.
// 1.4 Invalidates proxy caches.
rpc AlterAlias(milvus.AlterAliasRequest) returns (common.Status) {}
|
...
// UPDATED REQUIRED |
...
// Collection can't be dropped it is referenced by an `alias`.
rpc DropCollection(DropCollectionRequest) returns (common.Status) {}
|
...
// UPDATED REQUIRED |
...
// DescribeCollection now returns `aliases` rpc DescribeCollection(DescribeCollectionRequest) returns (DescribeCollectionResponse) {} } |
Compatibility, Deprecation, and Migration Plan
...