diff --git a/errors.toml b/errors.toml index 740f0eadc12..c3f412a6dc5 100644 --- a/errors.toml +++ b/errors.toml @@ -611,11 +611,6 @@ error = ''' get local allocator failed, %s ''' -["PD:tso:ErrInvalidTimestamp"] -error = ''' -invalid timestamp -''' - ["PD:tso:ErrLogicOverflow"] error = ''' logic part overflow diff --git a/metrics/grafana/pd.json b/metrics/grafana/pd.json index 9ece3ea936f..a40158ab03a 100644 --- a/metrics/grafana/pd.json +++ b/metrics/grafana/pd.json @@ -9124,7 +9124,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "PD server TSO handle time + Client revc time", + "title": "PD server TSO handle time", "tooltip": { "msResolution": false, "shared": true, diff --git a/pkg/errs/errno.go b/pkg/errs/errno.go index cdf33435fff..6f58b4a5b96 100644 --- a/pkg/errs/errno.go +++ b/pkg/errs/errno.go @@ -37,7 +37,6 @@ var ( ErrSyncMaxTS = errors.Normalize("sync max ts failed, %s", errors.RFCCodeText("PD:tso:ErrSyncMaxTS")) ErrResetUserTimestamp = errors.Normalize("reset user timestamp failed, %s", errors.RFCCodeText("PD:tso:ErrResetUserTimestamp")) ErrGenerateTimestamp = errors.Normalize("generate timestamp failed, %s", errors.RFCCodeText("PD:tso:ErrGenerateTimestamp")) - ErrInvalidTimestamp = errors.Normalize("invalid timestamp", errors.RFCCodeText("PD:tso:ErrInvalidTimestamp")) ErrLogicOverflow = errors.Normalize("logic part overflow", errors.RFCCodeText("PD:tso:ErrLogicOverflow")) ) diff --git a/pkg/errs/errs_test.go b/pkg/errs/errs_test.go index 796b2d1019b..cf3a563b788 100644 --- a/pkg/errs/errs_test.go +++ b/pkg/errs/errs_test.go @@ -85,10 +85,10 @@ func (s *testErrorSuite) TestError(c *C) { log.ReplaceGlobals(lg.Logger, nil) rfc := `[error="[PD:tso:ErrInvalidTimestamp]invalid timestamp"]` - log.Error("test", zap.Error(ErrInvalidTimestamp.FastGenByArgs())) + log.Error("test", zap.Error(ErrEtcdLeaderNotFound.FastGenByArgs())) c.Assert(strings.Contains(lg.Message(), rfc), IsTrue) err := errors.New("test error") - log.Error("test", ZapError(ErrInvalidTimestamp, err)) + log.Error("test", ZapError(ErrEtcdLeaderNotFound, err)) rfc = `[error="[PD:tso:ErrInvalidTimestamp]test error"]` c.Assert(strings.Contains(lg.Message(), rfc), IsTrue) } diff --git a/server/tso/global_allocator.go b/server/tso/global_allocator.go index 484951c819d..4788c4e3231 100644 --- a/server/tso/global_allocator.go +++ b/server/tso/global_allocator.go @@ -104,10 +104,6 @@ func (gta *GlobalTSOAllocator) getSyncRTT() int64 { func (gta *GlobalTSOAllocator) estimateMaxTS(count uint32, suffixBits int) (*pdpb.Timestamp, bool, error) { physical, logical, lastUpdateTime := gta.timestampOracle.generateTSO(int64(count), 0) if physical == 0 { - log.Error("invalid global tso in memory, unable to estimate maxTSO", - zap.Any("timestamp-physical", physical), - zap.Any("timestamp-logical", logical), - errs.ZapError(errs.ErrInvalidTimestamp)) return &pdpb.Timestamp{}, false, errs.ErrGenerateTimestamp.FastGenByArgs("timestamp in memory isn't initialized") } estimatedMaxTSO := &pdpb.Timestamp{ diff --git a/server/tso/tso.go b/server/tso/tso.go index b851d02ea2a..eb13f09ef28 100644 --- a/server/tso/tso.go +++ b/server/tso/tso.go @@ -358,7 +358,7 @@ func (t *timestampOracle) getTS(leadership *election.Leadership, count uint32, s return resp, errs.ErrGenerateTimestamp.FastGenByArgs("tso count should be positive") } for i := 0; i < maxRetryCount; i++ { - currentPhysical, currentLogical := t.getTSO() + currentPhysical, _ := t.getTSO() if currentPhysical == typeutil.ZeroTime { // If it's leader, maybe SyncTimestamp hasn't completed yet if leadership.Check() { @@ -366,10 +366,6 @@ func (t *timestampOracle) getTS(leadership *election.Leadership, count uint32, s continue } tsoCounter.WithLabelValues("not_leader_anymore", t.dcLocation).Inc() - log.Error("invalid timestamp", - zap.Any("timestamp-physical", currentPhysical), - zap.Any("timestamp-logical", currentLogical), - errs.ZapError(errs.ErrInvalidTimestamp)) return pdpb.Timestamp{}, errs.ErrGenerateTimestamp.FastGenByArgs("timestamp in memory isn't initialized") } // Get a new TSO result with the given count