Skip to content

Commit

Permalink
Update etcd error
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Sep 2, 2020
1 parent 1e9c751 commit 8f56ab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/errs/errno.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import "github.com/pingcap/errors"
// The internal error which is generated in PD project.
// tso errors
var (
ErrSaveTimestamp = errors.Normalize("save timestamp failed, %s", errors.RFCCodeText("PD:tso:ErrSaveTimestamp"))
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"))
Expand Down
4 changes: 2 additions & 2 deletions server/tso/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func (t *timestampOracle) saveTimestamp(leadership *election.Leadership, ts time
Then(clientv3.OpPut(key, string(data))).
Commit()
if err != nil {
return errs.ErrEtcdTxn.Wrap(err).GenWithStackByCause()
return errs.ErrEtcdKVPut.Wrap(err).GenWithStackByCause()
}
if !resp.Succeeded {
return errs.ErrSaveTimestamp.FastGenByArgs("maybe we lost leader")
return errs.ErrEtcdTxn.FastGenByArgs()
}

t.lastSavedTime.Store(ts)
Expand Down

0 comments on commit 8f56ab2

Please sign in to comment.