Current state: Disccusion completed
ISSUE: https://github.com/milvus-io/milvus/issues/17131
PRs: TODO
Keywords: Collection Alias, Atomic Switching
Released: TODO
Summary
- As the name indicates, CollectionAlias is an alias to an existing collection.
- The collection alias can be updated to a new collection.
- Within
RootCoordinator
,Proxy
, and all the key components,CollectionName
andCollectionAlias
are equal.
e.g.MetaTable.GetCollectionByName(collectionName string, ts typeutil.Timestamp)
can receiveCollectionAlias
and return correspondingCollectionInfo.
CollectionAlias
∧CollectionName
= ∅ .CollectionAlias
cannot collide with existingCollectionName
s.- When alias are added, droped or altered, all proxy should receive the change in the same timestamp.
- When alias are added, droped or altered, the operations online should not be affected, i.e. they still use the alias information when the tasks begin to excute.
Motivation
- As
CollectionAlias
works as an extra pointer to the existing collection in theRootCoordinator
, we can implement collection hot reloading at a low cost. - When
AddAlias
,DropAlias
andAlterAlias
, the change of relationship between alias and collection should not affect the operations online, i.e. these operations shoud use the relationship when the task begin to excute. - When
AddAlias
,DropAlias
andAlterAlias
, all proxy should receive the change in the same timestamp to ensure the atomicity between the proxy cache and the rootcoord data. - Users can't drop the
collection
if thecollection
is referenced by analias
, which can simplify the operation and make it easier to ensure the atomicity property about alias changes.
Public Interfaces
Change to Existing APIs
Metatable
now addts2alias2name
andnewestAliasTs
member variables
type immutablemap_string2string struct{ storemap map[string]string } func (imstr2str * immutablemap_string2string) get(key string) (string, error){ rstr,ok := imstr2str.storemap[key] if(!ok){ return nil, fmt.Errorf("key not exist") } return rstr, nil } func (imstr2str * immutablemap_string2string) put(key string, val string) (string, error){ return nil, fmt.Errorf("not allowed put in immutablemap") } type metatable struct{ ... ts2alias2name map[Timestamp]immutablemap_string2string newestAliasTs Timestamp ... }