diff --git a/server/tso.go b/server/tso.go index 2b3010178ea..aa4e3eb72cb 100644 --- a/server/tso.go +++ b/server/tso.go @@ -140,14 +140,14 @@ func (s *Server) updateTimestamp() error { return nil } -const maxRetryNum = 100 +const maxRetryCount = 100 func (s *Server) getRespTS() *pdpb.Timestamp { resp := &pdpb.Timestamp{} - for i := 0; i < maxRetryNum; i++ { + for i := 0; i < maxRetryCount; i++ { current, ok := s.ts.Load().(*atomicObject) if !ok { - log.Errorf("we haven't synced timestamp ok, wait and retry") + log.Errorf("we haven't synced timestamp ok, wait and retry, retry count %d", i) time.Sleep(200 * time.Millisecond) continue } @@ -155,7 +155,7 @@ func (s *Server) getRespTS() *pdpb.Timestamp { resp.Physical = proto.Int64(int64(current.physical.UnixNano()) / 1e6) resp.Logical = proto.Int64(atomic.AddInt64(¤t.logical, 1)) if *resp.Logical >= maxLogical { - log.Errorf("logical part outside of max logical interval %v, please check ntp time", resp) + log.Errorf("logical part outside of max logical interval %v, please check ntp time, retry count %d", resp, i) time.Sleep(50 * time.Millisecond) continue }