tikv / tikv/pd

`clock offset` is not clear enough

Open
#8,806 2 comments 1 reaction 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Enhancement Task
```
func (t *timestampOracle) UpdateTimestamp() error {
prevPhysical, prevLogical := t.getTSO()

now := time.Now()
t.metrics.saveEvent.Inc()

jetLag := typeutil.SubRealTimeByWallClock(now, prevPhysical)
if jetLag > 3*t.updatePhysicalInterval && jetLag > jetLagWarningThreshold {
log.Warn("clock offset",
logutil.CondUint32("keyspace-group-id", t.keyspaceGroupID, t.keyspaceGroupID > 0),
zap.Duration("jet-lag", jetLag),
zap.Time("prev-physical", prevPhysical),
zap.Time("now", now),
zap.Duration("update-physical-interval", t.updatePhysicalInterval))
t.metrics.slowSaveEvent.Inc()
}
...
```
From the above code, if the current system time is much later than the previous physical time or runtime issue, the log will be printed. But clock offset could be one of the reasons. So here, we'd better use a clearer log message that is less confusing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.