Add detailed comments for dataSyncService in DataNode (#11285)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/11354/head
congqixia 2021-11-05 22:59:04 +08:00 committed by GitHub
parent eac21d89af
commit 3ac7d7a9de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 9 deletions

View File

@ -36,17 +36,17 @@ import (
type dataSyncService struct {
ctx context.Context
cancelFn context.CancelFunc
fg *flowgraph.TimeTickedFlowGraph
flushCh chan flushMsg
replica Replica
idAllocator allocatorInterface
fg *flowgraph.TimeTickedFlowGraph // internal flowgraph processes insert/delta messages
flushCh chan flushMsg // chan to notify flush
replica Replica // segment replica stores meta
idAllocator allocatorInterface // id/timestamp allocator
msFactory msgstream.Factory
collectionID UniqueID
dataCoord types.DataCoord
clearSignal chan<- UniqueID
collectionID UniqueID // collection id of vchan for which this data sync service serves
dataCoord types.DataCoord // DataCoord instance to interact with
clearSignal chan<- UniqueID // signal channel to notify flowgraph close for collection/partition drop msg consumed
flushingSegCache *Cache
flushManager flushManager
flushingSegCache *Cache // a guarding cache stores currently flushing segment ids
flushManager flushManager // flush manager handles flush process
}
func newDataSyncService(ctx context.Context,
@ -156,6 +156,7 @@ func (dsService *dataSyncService) initNodes(vchanInfo *datapb.VchannelInfo) erro
return err
}
// initialize flush manager for DataSync Service
dsService.flushManager = NewRendezvousFlushManager(dsService.idAllocator, minIOKV, dsService.replica, func(pack *segmentFlushPack) error {
fieldInsert := []*datapb.FieldBinlog{}
fieldStats := []*datapb.FieldBinlog{}