[skip ci]Add more comments in chap06_root_coordinator.md (#10496)

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
This commit is contained in:
ryjiang 2021-10-23 16:52:05 +08:00 committed by GitHub
parent fa42d8d055
commit 779672bb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,14 @@ type RootCoord interface {
// otherwise, the `ErrorCode` of `Status` will be `Error`, and the `Reason` of `Status` will record the fail cause. // otherwise, the `ErrorCode` of `Status` will be `Error`, and the `Reason` of `Status` will record the fail cause.
// error is always nil // error is always nil
CreateCollection(ctx context.Context, req *milvuspb.CreateCollectionRequest) (*commonpb.Status, error) CreateCollection(ctx context.Context, req *milvuspb.CreateCollectionRequest) (*commonpb.Status, error)
// DropCollection notifies RootCoord to drop a collection
//
// ctx is the context to control request deadline and cancellation
// req contains the request params, including database name(not used) and collection name
//
// The `ErrorCode` of `Status` is `Success` if drop collection successfully;
// otherwise, the `ErrorCode` of `Status` will be `Error`, and the `Reason` of `Status` will record the fail cause.
// error is always nil
DropCollection(ctx context.Context, req *milvuspb.DropCollectionRequest) (*commonpb.Status, error) DropCollection(ctx context.Context, req *milvuspb.DropCollectionRequest) (*commonpb.Status, error)
HasCollection(ctx context.Context, req *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error) HasCollection(ctx context.Context, req *milvuspb.HasCollectionRequest) (*milvuspb.BoolResponse, error)
DescribeCollection(ctx context.Context, req *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error) DescribeCollection(ctx context.Context, req *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)
@ -61,9 +69,7 @@ type RootCoord interface {
} }
``` ```
- _MsgBase_
* *MsgBase*
```go ```go
type MsgBase struct { type MsgBase struct {
@ -74,7 +80,7 @@ type MsgBase struct {
} }
``` ```
* *CreateCollection* - _CreateCollection_
<img src="./figs/root_coord_create_collection.png"> <img src="./figs/root_coord_create_collection.png">
@ -88,7 +94,7 @@ type CreateCollectionRequest struct {
} }
``` ```
* *DropCollection* - _DropCollection_
```go ```go
type DropCollectionRequest struct { type DropCollectionRequest struct {
@ -98,7 +104,7 @@ type DropCollectionRequest struct {
} }
``` ```
* *HasCollection* - _HasCollection_
```go ```go
type HasCollectionRequest struct { type HasCollectionRequest struct {
@ -109,7 +115,7 @@ type HasCollectionRequest struct {
} }
``` ```
* *DescribeCollection* - _DescribeCollection_
```go ```go
type DescribeCollectionRequest struct { type DescribeCollectionRequest struct {
@ -134,7 +140,7 @@ type DescribeCollectionResponse struct {
} }
``` ```
* *ShowCollections* - _ShowCollections_
```go ```go
type ShowCollectionsRequest struct { type ShowCollectionsRequest struct {
@ -151,7 +157,7 @@ type ShowCollectionResponse struct {
} }
``` ```
* *CreatePartition* - _CreatePartition_
```go ```go
type CreatePartitionRequest struct { type CreatePartitionRequest struct {
@ -162,7 +168,7 @@ type CreatePartitionRequest struct {
} }
``` ```
* *DropPartition* - _DropPartition_
```go ```go
type DropPartitionRequest struct { type DropPartitionRequest struct {
@ -173,7 +179,7 @@ type DropPartitionRequest struct {
} }
``` ```
* *HasPartition* - _HasPartition_
```go ```go
type HasPartitionRequest struct { type HasPartitionRequest struct {
@ -184,7 +190,7 @@ type HasPartitionRequest struct {
} }
``` ```
* *ShowPartitions* - _ShowPartitions_
```go ```go
type ShowPartitionRequest struct { type ShowPartitionRequest struct {
@ -201,7 +207,7 @@ type ShowPartitionResponse struct {
} }
``` ```
* *DescribeSegment* - _DescribeSegment_
```go ```go
type DescribeSegmentRequest struct { type DescribeSegmentRequest struct {
@ -218,7 +224,7 @@ type DescribeSegmentResponse struct {
} }
``` ```
* *ShowSegments* - _ShowSegments_
```go ```go
type ShowSegmentsRequest struct { type ShowSegmentsRequest struct {
@ -233,7 +239,8 @@ type ShowSegmentsResponse struct {
} }
``` ```
* *ReleaseDQLMessageStream* - _ReleaseDQLMessageStream_
```go ```go
type ReleaseDQLMessageStreamRequest struct { type ReleaseDQLMessageStreamRequest struct {
Base *commonpb.MsgBase Base *commonpb.MsgBase
@ -243,7 +250,7 @@ type ReleaseDQLMessageStreamRequest struct {
``` ```
* *CreateIndex* - _CreateIndex_
<img src="./figs/root_coord_create_index.png"> <img src="./figs/root_coord_create_index.png">
```go ```go
@ -256,7 +263,7 @@ type CreateIndexRequest struct {
} }
``` ```
* *DescribeIndex* - _DescribeIndex_
```go ```go
type DescribeIndexRequest struct { type DescribeIndexRequest struct {
@ -280,7 +287,7 @@ type DescribeIndexResponse struct {
} }
``` ```
* *DropIndex* - _DropIndex_
```go ```go
type DropIndexRequest struct { type DropIndexRequest struct {
@ -292,7 +299,7 @@ type DropIndexRequest struct {
} }
``` ```
* *AllocTimestamp* - _AllocTimestamp_
```go ```go
type AllocTimestampRequest struct { type AllocTimestampRequest struct {
@ -307,7 +314,7 @@ type AllocTimestampResponse struct {
} }
``` ```
* *AllocID* - _AllocID_
```go ```go
type AllocIDRequest struct { type AllocIDRequest struct {
@ -322,7 +329,7 @@ type AllocIDResponse struct {
} }
``` ```
* *UpdateChannelTimeTick* - _UpdateChannelTimeTick_
```go ```go
type ChannelTimeTickMsg struct { type ChannelTimeTickMsg struct {
@ -337,7 +344,7 @@ type ChannelTimeTickMsg struct {
`RC` would put `Dd Message` into the `DML MsgSteams` `RC` would put `Dd Message` into the `DML MsgSteams`
* *BaseMsg* - _BaseMsg_
```go ```go
type BaseMsg struct { type BaseMsg struct {
@ -349,7 +356,7 @@ type BaseMsg struct {
} }
``` ```
* *CreateCollectionMsg* - _CreateCollectionMsg_
```go ```go
type CreateCollectionRequest struct { type CreateCollectionRequest struct {
@ -369,7 +376,7 @@ type CreateCollectionMsg struct {
} }
``` ```
* *DropCollectionMsg* - _DropCollectionMsg_
```go ```go
type DropCollectionRequest struct { type DropCollectionRequest struct {
@ -386,7 +393,7 @@ type DropCollectionMsg struct {
} }
``` ```
* *CreatePartitionMsg* - _CreatePartitionMsg_
```go ```go
type CreatePartitionRequest struct { type CreatePartitionRequest struct {
@ -405,7 +412,7 @@ type CreatePartitionMsg struct {
} }
``` ```
* *DropPartitionMsg* - _DropPartitionMsg_
```go ```go
type DropPartitionRequest struct { type DropPartitionRequest struct {
@ -425,6 +432,7 @@ type DropPartitionMsg struct {
``` ```
#### 6.3 Create Index automatically #### 6.3 Create Index automatically
`RC` would notify `IC(Index Coord)` to build index automatically when the segment has been flushed. `RC` would notify `IC(Index Coord)` to build index automatically when the segment has been flushed.
<img src="./figs/root_coord_create_index_automatically.png"> <img src="./figs/root_coord_create_index_automatically.png">
@ -514,7 +522,6 @@ type Core struct {
} }
``` ```
#### 6.5 Data definition Request Scheduler #### 6.5 Data definition Request Scheduler
###### 6.5.1 Task ###### 6.5.1 Task
@ -549,15 +556,14 @@ func (t *CreateCollectionReqTask) Notify(err error)
In most cases, a data definition task need to In most cases, a data definition task need to
* update system's meta data (via $metaTable$), - update system's meta data (via $metaTable$),
* send `DD Message` into related `DML MsgStream`, so that the `Data Node` and `Query Node` would take it - send `DD Message` into related `DML MsgStream`, so that the `Data Node` and `Query Node` would take it
#### 6.6 Meta Table #### 6.6 Meta Table
###### 6.6.1 Meta ###### 6.6.1 Meta
* Tenant Meta - Tenant Meta
```protobuf ```protobuf
message TenantMeta { message TenantMeta {
@ -568,7 +574,7 @@ message TenantMeta {
} }
``` ```
* Proxy Meta - Proxy Meta
```protobuf ```protobuf
message ProxyMeta { message ProxyMeta {
@ -578,7 +584,7 @@ message ProxyMeta {
} }
``` ```
* Collection Meta - Collection Meta
```protobuf ```protobuf
message PartitionInfo { message PartitionInfo {
@ -609,7 +615,7 @@ message CollectionInfo {
} }
``` ```
* Segment Meta - Segment Meta
```protobuf ```protobuf
message SegmentIndexInfo { message SegmentIndexInfo {
@ -632,10 +638,9 @@ message SegmentIndexInfo {
"segment-index/$collectionId/$indexId/$partitionId/$segmentId" -> segmentIndexInfoBlog string "segment-index/$collectionId/$indexId/$partitionId/$segmentId" -> segmentIndexInfoBlog string
``` ```
Note that *tenantId*, *proxyId*, *collectionId*, *partitionId*, *indexId*, *segmentId* are unique strings converted from int64. Note that _tenantId_, _proxyId_, _collectionId_, _partitionId_, _indexId_, _segmentId_ are unique strings converted from int64.
*tenantMetaBlob*, *proxyMetaBlob*, *collectionInfoBlob*, *partitionInfoBlob*, *IndexInfoBlob*, *segmentIndexInfoBlog* are serialized protos.
_tenantMetaBlob_, _proxyMetaBlob_, _collectionInfoBlob_, _partitionInfoBlob_, _IndexInfoBlob_, _segmentIndexInfoBlog_ are serialized protos.
###### 6.6.3 Meta Table ###### 6.6.3 Meta Table
@ -690,11 +695,9 @@ func (mt *metaTable) GetIndexByID(indexID typeutil.UniqueID) (*pb.IndexInfo, err
func (mt *metaTable) AddFlushedSegment(segID typeutil.UniqueID) error func (mt *metaTable) AddFlushedSegment(segID typeutil.UniqueID) error
``` ```
* *metaTable* maintains meta both in memory and *etcdKV*. It keeps meta's consistency in both sides. All its member functions may be called concurrently. - _metaTable_ maintains meta both in memory and _etcdKV_. It keeps meta's consistency in both sides. All its member functions may be called concurrently.
* for *HasCollection*, *GetCollectionByID*, *GetCollectionByName*, *ListCollections*, if the argument of `ts` is none-zero, then *metaTable* would return the meta on the timestamp of `ts`; if `ts` is zero, *metaTable* would return the lastest meta
- for _HasCollection_, _GetCollectionByID_, _GetCollectionByName_, _ListCollections_, if the argument of `ts` is none-zero, then _metaTable_ would return the meta on the timestamp of `ts`; if `ts` is zero, _metaTable_ would return the lastest meta
#### 6.7 System Time Synchronization #### 6.7 System Time Synchronization