Replace Tracef with Debugf for sync fast path logging

This commit is contained in:
mlsmaycon
2026-04-22 00:06:39 +02:00
parent 46446acd30
commit 66494d61af

View File

@@ -158,11 +158,11 @@ func (s *Server) tryFastPathSync(
cached, hit := s.peerSerialCache.Get(peerKey.String())
if !shouldSkipNetworkMap(peerMeta.GoOS, hit, cached, network.CurrentSerial(), peerMetaHash) {
log.WithContext(ctx).Tracef("fast path: checking for fast path eligibility for peer took %s", time.Since(reqStart))
log.WithContext(ctx).Debugf("fast path: checking for fast path eligibility for peer took %s", time.Since(reqStart))
return false, nil
}
log.WithContext(ctx).Tracef("fast path: checking for fast path eligibility for peer took %s", time.Since(reqStart))
log.WithContext(ctx).Debugf("fast path: checking for fast path eligibility for peer took %s", time.Since(reqStart))
peer, updates, committed := s.commitFastPath(ctx, accountID, peerKey, realIP, syncStart, network.CurrentSerial())
if !committed {
@@ -186,13 +186,13 @@ func (s *Server) commitFastPath(
syncStart time.Time,
expectedSerial uint64,
) (*nbpeer.Peer, chan *network_map.UpdateMessage, bool) {
defer log.WithContext(ctx).Tracef("fast path: commitFastPath took %s", time.Since(syncStart))
defer log.WithContext(ctx).Debugf("fast path: commitFastPath took %s", time.Since(syncStart))
if err := s.accountManager.MarkPeerConnected(ctx, peerKey.String(), true, realIP, accountID, syncStart); err != nil {
log.WithContext(ctx).Warnf("fast path: mark connected for peer %s: %v", peerKey.String(), err)
}
log.WithContext(ctx).Tracef("fast path: mark peer connected took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("fast path: mark peer connected took %s", time.Since(syncStart))
peer, err := s.accountManager.GetStore().GetPeerByPeerPubKey(ctx, store.LockingStrengthNone, peerKey.String())
if err != nil {
@@ -200,7 +200,7 @@ func (s *Server) commitFastPath(
return nil, nil, false
}
log.WithContext(ctx).Tracef("fast path: get peer took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("fast path: get peer took %s", time.Since(syncStart))
updates, err := s.networkMapController.OnPeerConnected(ctx, accountID, peer.ID)
if err != nil {
@@ -208,7 +208,7 @@ func (s *Server) commitFastPath(
return nil, nil, false
}
log.WithContext(ctx).Tracef("fast path: on peer connected took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("fast path: on peer connected took %s", time.Since(syncStart))
network, err := s.accountManager.GetStore().GetAccountNetwork(ctx, store.LockingStrengthNone, accountID)
if err != nil {
@@ -217,7 +217,7 @@ func (s *Server) commitFastPath(
return nil, nil, false
}
log.WithContext(ctx).Tracef("fast path: get network took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("fast path: get network took %s", time.Since(syncStart))
if network.CurrentSerial() != expectedSerial {
log.WithContext(ctx).Debugf("fast path: serial advanced from %d to %d after subscribe, falling back to slow path for peer %s", expectedSerial, network.CurrentSerial(), peerKey.String())
@@ -251,7 +251,7 @@ func (s *Server) runFastPathSync(
return err
}
log.WithContext(ctx).Tracef("fast path: mark peer connected took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("fast path: mark peer connected took %s", time.Since(syncStart))
s.secretsManager.SetupRefresh(ctx, accountID, peer.ID)
@@ -263,7 +263,7 @@ func (s *Server) runFastPathSync(
if s.appMetrics != nil {
s.appMetrics.GRPCMetrics().CountSyncRequestDuration(time.Since(reqStart), accountID)
}
log.WithContext(ctx).Tracef("fast path: sync took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("fast path: sync took %s", time.Since(syncStart))
log.WithContext(ctx).Debugf("Sync (fast path) took %s", time.Since(reqStart))
s.syncSem.Add(-1)