Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: add tso retry number log info. #92

Merged
merged 2 commits into from
May 5, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ func (s *Server) getRespTS() *pdpb.Timestamp {
for i := 0; i < maxRetryNum; 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 number %d", i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/number/count/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

time.Sleep(200 * time.Millisecond)
continue
}

resp.Physical = proto.Int64(int64(current.physical.UnixNano()) / 1e6)
resp.Logical = proto.Int64(atomic.AddInt64(&current.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 number %d", resp, i)
time.Sleep(50 * time.Millisecond)
continue
}
Expand Down