mirror of https://github.com/milvus-io/milvus.git
Remove redundant logs (#19412)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com> Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/18982/head
parent
dff4d1042e
commit
c15b880f0e
|
@ -22,10 +22,8 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/api/commonpb"
|
||||
"github.com/milvus-io/milvus/internal/log"
|
||||
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
|
||||
"github.com/milvus-io/milvus/internal/util/typeutil"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -137,10 +135,6 @@ func (ia *IDAllocator) pickCanDoFunc() {
|
|||
}
|
||||
}
|
||||
ia.ToDoReqs = ia.ToDoReqs[idx:]
|
||||
log.Debug("IDAllocator pickCanDoFunc",
|
||||
zap.Uint32("need", need),
|
||||
zap.Uint32("total", total),
|
||||
zap.Int("remainReqCnt", len(ia.ToDoReqs)))
|
||||
}
|
||||
|
||||
func (ia *IDAllocator) processFunc(req Request) error {
|
||||
|
|
|
@ -63,7 +63,7 @@ func (c *channelStateTimer) loadAllChannels(nodeID UniqueID) ([]*datapb.ChannelW
|
|||
return nil, err
|
||||
}
|
||||
|
||||
ret := []*datapb.ChannelWatchInfo{}
|
||||
var ret []*datapb.ChannelWatchInfo
|
||||
|
||||
for i, k := range keys {
|
||||
watchInfo, err := parseWatchInfo(k, []byte(values[i]))
|
||||
|
@ -101,7 +101,7 @@ func (c *channelStateTimer) startOne(watchState datapb.ChannelWatchState, channe
|
|||
zap.Time("timeout time", timeoutT))
|
||||
select {
|
||||
case <-time.NewTimer(time.Until(timeoutT)).C:
|
||||
log.Info("timeout and stop timer: wait for channel ACK timeout",
|
||||
log.Debug("timeout and stop timer: wait for channel ACK timeout",
|
||||
zap.String("watch state", watchState.String()),
|
||||
zap.Int64("nodeID", nodeID),
|
||||
zap.String("channel name", channelName),
|
||||
|
|
|
@ -742,11 +742,8 @@ func (c *ChannelManager) Reassign(nodeID UniqueID, channelName string) error {
|
|||
if err := c.remove(nodeID, ch); err != nil {
|
||||
return fmt.Errorf("failed to remove watch info: %v,%s", ch, err.Error())
|
||||
}
|
||||
|
||||
log.Debug("try to cleanup removal flag ", zap.String("channel name", channelName))
|
||||
c.h.FinishDropChannel(channelName)
|
||||
|
||||
log.Info("removed channel assignment", zap.Any("channel", ch))
|
||||
log.Info("removed channel assignment", zap.String("channel name", channelName))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -1044,11 +1044,9 @@ func (s *Server) WatchChannels(ctx context.Context, req *datapb.WatchChannelsReq
|
|||
|
||||
// GetFlushState gets the flush state of multiple segments
|
||||
func (s *Server) GetFlushState(ctx context.Context, req *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error) {
|
||||
log.Info("DataCoord receive get flush state request", zap.Int64s("segmentIDs", req.GetSegmentIDs()), zap.Int("len", len(req.GetSegmentIDs())))
|
||||
|
||||
resp := &milvuspb.GetFlushStateResponse{Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_UnexpectedError}}
|
||||
if s.isClosed() {
|
||||
log.Warn("failed to get flush state because of closed server",
|
||||
log.Warn("DataCoord receive GetFlushState request, server closed",
|
||||
zap.Int64s("segmentIDs", req.GetSegmentIDs()), zap.Int("len", len(req.GetSegmentIDs())))
|
||||
resp.Status.Reason = msgDataCoordIsUnhealthy(Params.DataCoordCfg.GetNodeID())
|
||||
return resp, nil
|
||||
|
@ -1062,18 +1060,16 @@ func (s *Server) GetFlushState(ctx context.Context, req *milvuspb.GetFlushStateR
|
|||
segment.GetState() == commonpb.SegmentState_Flushed {
|
||||
continue
|
||||
}
|
||||
|
||||
unflushed = append(unflushed, sid)
|
||||
}
|
||||
|
||||
if len(unflushed) != 0 {
|
||||
log.Info("[flush state] unflushed segment ids", zap.Int64s("segmentIDs", unflushed), zap.Int("len", len(unflushed)))
|
||||
log.Info("DataCoord receive GetFlushState request, Flushed is false", zap.Int64s("segmentIDs", unflushed), zap.Int("len", len(unflushed)))
|
||||
resp.Flushed = false
|
||||
} else {
|
||||
log.Info("[flush state] all segment is flushed", zap.Int64s("segment ids", req.GetSegmentIDs()))
|
||||
log.Info("DataCoord receive GetFlushState request, Flushed is true", zap.Int64s("segmentIDs", req.GetSegmentIDs()), zap.Int("len", len(req.GetSegmentIDs())))
|
||||
resp.Flushed = true
|
||||
}
|
||||
|
||||
resp.Status.ErrorCode = commonpb.ErrorCode_Success
|
||||
return resp, nil
|
||||
}
|
||||
|
|
|
@ -393,15 +393,12 @@ func parseDeleteEventKey(key string) string {
|
|||
|
||||
func (node *DataNode) handlePutEvent(watchInfo *datapb.ChannelWatchInfo, version int64) (err error) {
|
||||
vChanName := watchInfo.GetVchan().GetChannelName()
|
||||
log.Info("handle put event", zap.String("watch state", watchInfo.State.String()), zap.String("vChanName", vChanName))
|
||||
|
||||
switch watchInfo.State {
|
||||
case datapb.ChannelWatchState_Uncomplete, datapb.ChannelWatchState_ToWatch:
|
||||
if err := node.flowgraphManager.addAndStart(node, watchInfo.GetVchan()); err != nil {
|
||||
return fmt.Errorf("fail to add and start flowgraph for vChanName: %s, err: %v", vChanName, err)
|
||||
}
|
||||
|
||||
log.Debug("handle put event: new data sync service success", zap.String("vChanName", vChanName))
|
||||
log.Info("handle put event: new data sync service success", zap.String("vChanName", vChanName))
|
||||
watchInfo.State = datapb.ChannelWatchState_WatchSuccess
|
||||
|
||||
case datapb.ChannelWatchState_ToRelease:
|
||||
|
@ -429,12 +426,14 @@ func (node *DataNode) handlePutEvent(watchInfo *datapb.ChannelWatchInfo, version
|
|||
// etcd valid but the states updated.
|
||||
if !success {
|
||||
log.Info("handle put event: failed to compare version and swap, release flowgraph",
|
||||
zap.String("key", key), zap.String("state", watchInfo.State.String()))
|
||||
zap.String("key", key), zap.String("state", watchInfo.State.String()),
|
||||
zap.String("vChanName", vChanName))
|
||||
// flow graph will leak if not release, causing new datanode failed to subscribe
|
||||
node.tryToReleaseFlowgraph(vChanName)
|
||||
return nil
|
||||
}
|
||||
log.Info("handle put event successfully", zap.String("key", key), zap.String("state", watchInfo.State.String()))
|
||||
log.Info("handle put event success", zap.String("key", key),
|
||||
zap.String("state", watchInfo.State.String()), zap.String("vChanName", vChanName))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -444,8 +443,8 @@ func (node *DataNode) handleDeleteEvent(vChanName string) {
|
|||
|
||||
// tryToReleaseFlowgraph tries to release a flowgraph
|
||||
func (node *DataNode) tryToReleaseFlowgraph(vChanName string) {
|
||||
log.Info("try to release flowgraph", zap.String("vChanName", vChanName))
|
||||
node.flowgraphManager.release(vChanName)
|
||||
log.Info("try to release flowgraph success", zap.String("vChanName", vChanName))
|
||||
}
|
||||
|
||||
// BackGroundGC runs in background to release datanode resources
|
||||
|
@ -455,7 +454,6 @@ func (node *DataNode) BackGroundGC(vChannelCh <-chan string) {
|
|||
for {
|
||||
select {
|
||||
case vchanName := <-vChannelCh:
|
||||
log.Info("GC flowgraph", zap.String("vChanName", vchanName))
|
||||
node.tryToReleaseFlowgraph(vchanName)
|
||||
case <-node.ctx.Done():
|
||||
log.Warn("DataNode context done, exiting background GC")
|
||||
|
|
|
@ -128,12 +128,8 @@ func (e *channelEventManager) retryHandlePutEvent(event event) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
err = e.handlePutEvent(event.info, event.version)
|
||||
if err != nil {
|
||||
log.Warn("failed to handle put event", zap.String("vChanName", event.vChanName), zap.Error(err))
|
||||
// no need to retry here,
|
||||
} else {
|
||||
if err == nil {
|
||||
log.Info("handle put event successfully", zap.String("vChanName", event.vChanName))
|
||||
return
|
||||
}
|
||||
|
|
|
@ -36,12 +36,6 @@ func newFlowgraphManager() *flowgraphManager {
|
|||
}
|
||||
|
||||
func (fm *flowgraphManager) addAndStart(dn *DataNode, vchan *datapb.VchannelInfo) error {
|
||||
log.Info("received Vchannel Info",
|
||||
zap.String("vChannelName", vchan.GetChannelName()),
|
||||
zap.Int("Unflushed Segment Number", len(vchan.GetUnflushedSegmentIds())),
|
||||
zap.Int("Flushed Segment Number", len(vchan.GetFlushedSegmentIds())),
|
||||
)
|
||||
|
||||
if _, ok := fm.flowgraphs.Load(vchan.GetChannelName()); ok {
|
||||
log.Warn("try to add an existed DataSyncService", zap.String("vChannelName", vchan.GetChannelName()))
|
||||
return nil
|
||||
|
@ -61,11 +55,7 @@ func (fm *flowgraphManager) addAndStart(dn *DataNode, vchan *datapb.VchannelInfo
|
|||
log.Warn("new data sync service fail", zap.String("vChannelName", vchan.GetChannelName()), zap.Error(err))
|
||||
return err
|
||||
}
|
||||
log.Info("successfully created dataSyncService", zap.String("vChannelName", vchan.GetChannelName()))
|
||||
|
||||
dataSyncService.start()
|
||||
log.Info("successfully started dataSyncService", zap.String("vChannelName", vchan.GetChannelName()))
|
||||
|
||||
fm.flowgraphs.Store(vchan.GetChannelName(), dataSyncService)
|
||||
|
||||
metrics.DataNodeNumFlowGraphs.WithLabelValues(fmt.Sprint(Params.DataNodeCfg.GetNodeID())).Inc()
|
||||
|
@ -73,14 +63,11 @@ func (fm *flowgraphManager) addAndStart(dn *DataNode, vchan *datapb.VchannelInfo
|
|||
}
|
||||
|
||||
func (fm *flowgraphManager) release(vchanName string) {
|
||||
log.Info("release flowgraph resources begin", zap.String("vChannelName", vchanName))
|
||||
|
||||
if fg, loaded := fm.flowgraphs.LoadAndDelete(vchanName); loaded {
|
||||
fg.(*dataSyncService).close()
|
||||
metrics.DataNodeNumFlowGraphs.WithLabelValues(fmt.Sprint(Params.DataNodeCfg.GetNodeID())).Dec()
|
||||
}
|
||||
rateCol.removeFlowGraphChannel(vchanName)
|
||||
log.Info("release flowgraph resources end", zap.String("Vchannel", vchanName))
|
||||
}
|
||||
|
||||
func (fm *flowgraphManager) getFlushCh(segID UniqueID) (chan<- flushMsg, error) {
|
||||
|
|
|
@ -202,8 +202,8 @@ func newReplica(ctx context.Context, rc types.RootCoord, cm storage.ChunkManager
|
|||
// try to cache latest schema
|
||||
_, err := replica.getCollectionSchema(collID, 0)
|
||||
if err != nil {
|
||||
log.Warn("failed to get schema when create replica", zap.Int64("collID", collID), zap.Error(err))
|
||||
return nil, err
|
||||
err2 := fmt.Errorf("replica get schema for collection %d failed:%w", collID, err)
|
||||
return nil, err2
|
||||
}
|
||||
|
||||
return replica, nil
|
||||
|
@ -758,17 +758,12 @@ func (replica *SegmentReplica) getCollectionID() UniqueID {
|
|||
// If you want the latest collection schema, ts should be 0.
|
||||
func (replica *SegmentReplica) getCollectionSchema(collID UniqueID, ts Timestamp) (*schemapb.CollectionSchema, error) {
|
||||
if !replica.validCollection(collID) {
|
||||
log.Warn("Mismatch collection for the replica",
|
||||
zap.Int64("Want", replica.collectionID),
|
||||
zap.Int64("Actual", collID),
|
||||
)
|
||||
return nil, fmt.Errorf("not supported collection %v", collID)
|
||||
return nil, fmt.Errorf("mismatch collection, want %d, actual %d", replica.collectionID, collID)
|
||||
}
|
||||
|
||||
if replica.collSchema == nil {
|
||||
sch, err := replica.metaService.getCollectionSchema(context.Background(), collID, ts)
|
||||
if err != nil {
|
||||
log.Error("Grpc error", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
replica.collSchema = sch
|
||||
|
|
|
@ -120,17 +120,12 @@ func (fsw *flushedSegmentWatcher) enqueueInternalTask(segmentID UniqueID) {
|
|||
defer fsw.internalNotifyFunc()
|
||||
fsw.internalTaskMutex.Lock()
|
||||
defer fsw.internalTaskMutex.Unlock()
|
||||
|
||||
log.Ctx(fsw.ctx).Info("flushedSegmentWatcher enqueueInternalTask", zap.Int64("segmentID", segmentID))
|
||||
|
||||
if _, ok := fsw.internalTasks[segmentID]; !ok {
|
||||
fsw.internalTasks[segmentID] = &internalTask{
|
||||
state: indexTaskPrepare,
|
||||
segmentInfo: nil,
|
||||
}
|
||||
}
|
||||
|
||||
log.Ctx(fsw.ctx).Info("flushedSegmentWatcher already have the task success", zap.Int64("segmentID", segmentID))
|
||||
}
|
||||
|
||||
func (fsw *flushedSegmentWatcher) internalScheduler() {
|
||||
|
@ -157,8 +152,6 @@ func (fsw *flushedSegmentWatcher) internalRun() {
|
|||
fsw.internalTaskMutex.RLock()
|
||||
segmentIDs := make([]UniqueID, 0, len(fsw.internalTasks))
|
||||
if len(fsw.internalTasks) > 0 {
|
||||
log.Ctx(fsw.ctx).Debug("IndexCoord flushedSegmentWatcher schedule internal tasks",
|
||||
zap.Int("internal task num", len(fsw.internalTasks)))
|
||||
for segID := range fsw.internalTasks {
|
||||
segmentIDs = append(segmentIDs, segID)
|
||||
}
|
||||
|
|
|
@ -674,7 +674,6 @@ func (i *IndexCoord) DropIndex(ctx context.Context, req *indexpb.DropIndexReques
|
|||
|
||||
// GetIndexInfos gets the index file paths from IndexCoord.
|
||||
func (i *IndexCoord) GetIndexInfos(ctx context.Context, req *indexpb.GetIndexInfoRequest) (*indexpb.GetIndexInfoResponse, error) {
|
||||
log.Debug("IndexCoord GetIndexFilePaths", zap.String("indexName", req.IndexName), zap.Int64s("segmentIDs", req.SegmentIDs))
|
||||
if !i.isHealthy() {
|
||||
log.Warn(msgIndexCoordIsUnhealthy(i.serverID))
|
||||
return &indexpb.GetIndexInfoResponse{
|
||||
|
@ -719,15 +718,11 @@ func (i *IndexCoord) GetIndexInfos(ctx context.Context, req *indexpb.GetIndexInf
|
|||
}
|
||||
}
|
||||
|
||||
log.Info("IndexCoord GetIndexFilePaths ", zap.Int("segIDs num", len(req.SegmentIDs)),
|
||||
zap.Int("file path num", len(ret.SegmentInfo)))
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// DescribeIndex describe the index info of the collection.
|
||||
func (i *IndexCoord) DescribeIndex(ctx context.Context, req *indexpb.DescribeIndexRequest) (*indexpb.DescribeIndexResponse, error) {
|
||||
log.Info("IndexCoord receive DescribeIndex", zap.Int64("collID", req.CollectionID))
|
||||
if !i.isHealthy() {
|
||||
log.Warn(msgIndexCoordIsUnhealthy(i.serverID))
|
||||
return &indexpb.DescribeIndexResponse{
|
||||
|
|
Loading…
Reference in New Issue