Skip to content

Commit

Permalink
server: log store initialization duration and replica count
Browse files Browse the repository at this point in the history
Epic: none
Release note: None
  • Loading branch information
erikgrinaker committed Dec 7, 2023
1 parent 161d4f5 commit b145e49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/server/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,13 +672,15 @@ func (n *Node) start(
err := n.stopper.RunAsyncTaskEx(ctx,
stop.TaskOpts{TaskName: "initialize-stores", SpanOpt: stop.FollowsFromSpan, Sem: sem, WaitForSem: true},
func(ctx context.Context) {
start := timeutil.Now()
s := kvserver.NewStore(ctx, n.storeCfg, engine, &n.Descriptor)
if err := s.Start(workersCtx, n.stopper); err != nil {
engineErrC <- errors.Wrap(err, "failed to start store")
return
}
n.addStore(ctx, s)
log.Infof(ctx, "initialized store s%s", s.StoreID())
log.Infof(ctx, "initialized store s%s in %s (%d replicas)",
s.StoreID(), timeutil.Since(start).Truncate(time.Millisecond), s.ReplicaCount())
engineErrC <- nil
})
if err != nil {
Expand Down Expand Up @@ -908,7 +910,7 @@ func (n *Node) initializeAdditionalStores(
}

n.addStore(ctx, s)
log.Infof(ctx, "initialized store s%s", s.StoreID())
log.Infof(ctx, "initialized new store s%s", s.StoreID())

// Done regularly in Node.startGossiping, but this cuts down the time
// until this store is used for range allocations.
Expand Down

0 comments on commit b145e49

Please sign in to comment.