mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Add time log for methods of starting the node (#20313)
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
b97c36cd41
commit
9c6436d72d
@ -23,6 +23,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/timerecord"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/milvus-io/milvus/internal/kv"
|
||||
"github.com/milvus-io/milvus/internal/proto/datapb"
|
||||
@ -131,6 +133,7 @@ func NewChannelStore(kv kv.TxnKV) *ChannelStore {
|
||||
|
||||
// Reload restores the buffer channels and node-channels mapping from kv.
|
||||
func (c *ChannelStore) Reload() error {
|
||||
record := timerecord.NewTimeRecorder("datacoord")
|
||||
keys, values, err := c.store.LoadWithPrefix(Params.DataCoordCfg.ChannelWatchSubPath)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -156,6 +159,7 @@ func (c *ChannelStore) Reload() error {
|
||||
}
|
||||
c.channelsInfo[nodeID].Channels = append(c.channelsInfo[nodeID].Channels, channel)
|
||||
}
|
||||
record.Record("ChannelStore reload")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/timerecord"
|
||||
|
||||
"golang.org/x/exp/maps"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
@ -75,6 +77,7 @@ func newMeta(ctx context.Context, kv kv.TxnKV, chunkManagerRootPath string) (*me
|
||||
|
||||
// reloadFromKV loads meta from KV storage
|
||||
func (m *meta) reloadFromKV() error {
|
||||
record := timerecord.NewTimeRecorder("datacoord")
|
||||
segments, err := m.catalog.ListSegments(m.ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -96,6 +99,7 @@ func (m *meta) reloadFromKV() error {
|
||||
}
|
||||
metrics.DataCoordNumStoredRows.WithLabelValues().Set(float64(numStoredRows))
|
||||
metrics.DataCoordNumStoredRowsCounter.WithLabelValues().Add(float64(numStoredRows))
|
||||
record.Record("meta reloadFromKV")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@ import (
|
||||
"github.com/milvus-io/milvus/internal/proto/datapb"
|
||||
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
|
||||
"github.com/milvus-io/milvus/internal/util"
|
||||
"github.com/milvus-io/milvus/internal/util/timerecord"
|
||||
)
|
||||
|
||||
type flushedSegmentWatcher struct {
|
||||
@ -87,6 +88,7 @@ func newFlushSegmentWatcher(ctx context.Context, kv kv.MetaKv, meta *metaTable,
|
||||
}
|
||||
|
||||
func (fsw *flushedSegmentWatcher) reloadFromKV() error {
|
||||
record := timerecord.NewTimeRecorder("indexcoord")
|
||||
log.Ctx(fsw.ctx).Info("flushSegmentWatcher reloadFromKV")
|
||||
fsw.internalTasks = make(map[UniqueID]*internalTask)
|
||||
_, values, version, err := fsw.kvClient.LoadWithRevision(util.FlushedSegmentPrefix)
|
||||
@ -110,6 +112,7 @@ func (fsw *flushedSegmentWatcher) reloadFromKV() error {
|
||||
}
|
||||
fsw.etcdRevision = version
|
||||
log.Ctx(fsw.ctx).Info("flushSegmentWatcher reloadFromKV success", zap.Int64("etcdRevision", version))
|
||||
record.Record("flushedSegmentWatcher reloadFromKV")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@ import (
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/timerecord"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
@ -90,6 +92,7 @@ func (mt *metaTable) updateSegmentIndex(segIdx *model.SegmentIndex) {
|
||||
|
||||
// reloadFromKV reloads the index meta from ETCD.
|
||||
func (mt *metaTable) reloadFromKV() error {
|
||||
record := timerecord.NewTimeRecorder("indexcoord")
|
||||
mt.collectionIndexes = make(map[UniqueID]map[UniqueID]*model.Index)
|
||||
mt.segmentIndexes = make(map[UniqueID]map[UniqueID]*model.SegmentIndex)
|
||||
mt.buildID2SegmentIndex = make(map[UniqueID]*model.SegmentIndex)
|
||||
@ -115,6 +118,7 @@ func (mt *metaTable) reloadFromKV() error {
|
||||
}
|
||||
|
||||
log.Info("IndexCoord metaTable reloadFromKV success")
|
||||
record.Record("metaTable reloadFromKV")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,8 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/timerecord"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/commonpb"
|
||||
"github.com/milvus-io/milvus-proto/go-api/milvuspb"
|
||||
"github.com/milvus-io/milvus/internal/allocator"
|
||||
@ -239,6 +241,8 @@ func (s *Server) Init() error {
|
||||
}
|
||||
|
||||
func (s *Server) initMeta() error {
|
||||
record := timerecord.NewTimeRecorder("querycoord")
|
||||
|
||||
log.Info("init meta")
|
||||
s.store = meta.NewMetaStore(s.kv)
|
||||
s.meta = meta.NewMeta(s.idAllocator, s.store)
|
||||
@ -267,6 +271,7 @@ func (s *Server) initMeta() error {
|
||||
)
|
||||
s.targetMgr = meta.NewTargetManager(s.broker, s.meta)
|
||||
|
||||
record.Record("Server initMeta")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -22,6 +22,8 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/timerecord"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/common"
|
||||
|
||||
pb "github.com/milvus-io/milvus/internal/proto/etcdpb"
|
||||
@ -136,6 +138,7 @@ func (mt *MetaTable) reload() error {
|
||||
mt.ddLock.Lock()
|
||||
defer mt.ddLock.Unlock()
|
||||
|
||||
record := timerecord.NewTimeRecorder("rootcoord")
|
||||
mt.collID2Meta = make(map[UniqueID]*model.Collection)
|
||||
mt.collName2ID = make(map[string]UniqueID)
|
||||
mt.collAlias2ID = make(map[string]UniqueID)
|
||||
@ -159,6 +162,7 @@ func (mt *MetaTable) reload() error {
|
||||
mt.collAlias2ID[alias.Name] = alias.CollectionID
|
||||
}
|
||||
|
||||
record.Record("MetaTable reload")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user