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

tso: make tso log more clear #8826

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
5 changes: 2 additions & 3 deletions pkg/tso/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ func (t *timestampOracle) resetUserTimestampInner(leadership *election.Leadershi
return nil
}

// UpdateTimestamp is used to update the timestamp.
// This function will do two things:
// UpdateTimestamp will do two things:
// 1. When the logical time is going to be used up, increase the current physical time.
// 2. When the time window is not big enough, which means the saved etcd time minus the next physical time
// will be less than or equal to `UpdateTimestampGuard`, then the time window needs to be updated and
Expand Down Expand Up @@ -332,7 +331,7 @@ func (t *timestampOracle) UpdateTimestamp() error {

jetLag := typeutil.SubRealTimeByWallClock(now, prevPhysical)
if jetLag > 3*t.updatePhysicalInterval && jetLag > jetLagWarningThreshold {
log.Warn("clock offset",
log.Warn("There hasn't been a physical time update for a while, which may caused by PD restart, leader transfer, etcd IO lag, local time offset etc.",
logutil.CondUint32("keyspace-group-id", t.keyspaceGroupID, t.keyspaceGroupID > 0),
zap.Duration("jet-lag", jetLag),
zap.Time("prev-physical", prevPhysical),
Expand Down
Loading