Current state: Under Discussion
...
As CollectionAlias
works as an extra pointer to the existing collection in the RootCoordinator
, we can implement collection hot reloading at a much lower cost compared to the 1
, 2
approaches.
With CollectionAlias
, we can implement collection hot reloading functionality as such:
- Create Collection
A
& insert data. - Create CollectionAlias
Z
toA
. - Create Collection
B
& insert data. - Update CollectionAlias
Z
toB
. - Users can access new data with the
Z
alias.
Public Interfaces
New Public APIs
...
The recovery process will handle CreateAliasDDType , DropAliasDDType, AlterAliasDDType types.
Code Block |
---|
func (c *Core) reSendDdMsg(ctx context.Context) error { flag, err := c.MetaTable.client.Load(DDMsgSendPrefix, 0) if err != nil || flag == "true" { log.Debug("No un-successful DdMsg") return nil } ddOpStr, err := c.MetaTable.client.Load(DDOperationPrefix, 0) if err != nil { log.Debug("DdOperation key does not exist") return nil } var ddOp DdOperation if err = json.Unmarshal([]byte(ddOpStr), &ddOp); err != nil { return err } switch ddOp.Type { case CreateCollectionDDType: var ddReq = internalpb.CreateCollectionRequest{} if err = proto.UnmarshalText(ddOp.Body, &ddReq); err != nil { return err } collInfo, err := c.MetaTable.GetCollectionByName(ddReq.CollectionName, 0) if err != nil { return err } if err = c.SendDdCreateCollectionReq(ctx, &ddReq, collInfo.PhysicalChannelNames); err != nil { return err } // NEW case CreateAliasDDType: ... // NEW case DropAliasDDType: ... // NEW case AlterAliasDDType: ... ... } |
...