Skip to content

Commit 5a8f94f

Browse files
committed
tso: inline save reason in persist logs
Signed-off-by: Yuhao Zhang <yhzhang00@outlook.com>
1 parent 8edf2c7 commit 5a8f94f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/tso/tso.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ func (t *timestampOracle) syncTimestamp() error {
223223
t.metrics.syncSaveDuration.Observe(time.Since(start).Seconds())
224224

225225
t.metrics.syncOKEvent.Inc()
226-
log.Info("persisted tso window to etcd",
227-
zap.String("reason", "sync"),
226+
log.Info("persisted tso window to etcd (sync)",
228227
logutil.CondUint32("keyspace-group-id", t.keyspaceGroupID, t.keyspaceGroupID > 0),
229228
zap.String("member-name", t.member.Name()),
230229
zap.Time("etcd-last-saved-time", last),
@@ -296,8 +295,7 @@ func (t *timestampOracle) resetUserTimestamp(tso uint64, ignoreSmaller, skipUppe
296295
}
297296
t.lastSavedTime.Store(save)
298297
t.metrics.resetSaveDuration.Observe(time.Since(start).Seconds())
299-
log.Info("persisted tso window to etcd",
300-
zap.String("reason", "user-reset"),
298+
log.Info("persisted tso window to etcd (user-reset)",
301299
logutil.CondUint32("keyspace-group-id", t.keyspaceGroupID, t.keyspaceGroupID > 0),
302300
zap.String("member-name", t.member.Name()),
303301
zap.Time("saved-time", save),
@@ -409,8 +407,7 @@ func (t *timestampOracle) updateTimestamp(purpose updatePurpose) (bool, error) {
409407
}
410408
t.lastSavedTime.Store(save)
411409
t.metrics.updateSaveDuration.Observe(time.Since(start).Seconds())
412-
log.Debug("persisted tso window to etcd",
413-
zap.String("reason", "update"),
410+
log.Debug("persisted tso window to etcd (update)",
414411
logutil.CondUint32("keyspace-group-id", t.keyspaceGroupID, t.keyspaceGroupID > 0),
415412
zap.String("member-name", t.member.Name()),
416413
zap.Time("saved-time", save),

0 commit comments

Comments
 (0)