Refine some codes about the datanode (#17720)

Signed-off-by: SimFG <bang.fu@zilliz.com>
pull/17708/head
SimFG 2022-06-23 09:58:14 +08:00 committed by GitHub
parent f4c6a6734e
commit 50d5d04552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -594,7 +594,7 @@ func (c *ChannelManager) updateWithTimer(updates ChannelOpSet, state datapb.Chan
err := c.store.Update(updates)
if err != nil {
log.Warn("fail to update", zap.Array("updates", updates))
log.Warn("fail to update", zap.Array("updates", updates), zap.Error(err))
c.stateTimer.removeTimers(channelsWithTimer)
}
return err

View File

@ -85,20 +85,18 @@ func (fm *flowgraphManager) release(vchanName string) {
func (fm *flowgraphManager) getFlushCh(segID UniqueID) (chan<- flushMsg, error) {
var (
flushCh chan flushMsg
loaded = false
)
fm.flowgraphs.Range(func(key, value interface{}) bool {
fg := value.(*dataSyncService)
if fg.replica.hasSegment(segID, true) {
loaded = true
flushCh = fg.flushCh
return false
}
return true
})
if loaded {
if flushCh != nil {
return flushCh, nil
}

View File

@ -31,13 +31,12 @@ type TimeTickedFlowGraph struct {
// AddNode add Node into flowgraph
func (fg *TimeTickedFlowGraph) AddNode(node Node) {
nodeName := node.Name()
nodeCtx := nodeCtx{
node: node,
downstreamInputChanIdx: make(map[string]int),
closeCh: make(chan struct{}),
}
fg.nodeCtx[nodeName] = &nodeCtx
fg.nodeCtx[node.Name()] = &nodeCtx
}
// SetEdges set directed edges from in nodes to out nodes