Skip to content

Commit

Permalink
Merge branch 'release-4.0' into cherry-pick-1784-to-release-4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored May 19, 2021
2 parents 3782274 + d1d13c5 commit 9ebcc08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cdc/processor/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s *globalState) Update(key util.EtcdKey, value []byte, isInit bool) error
if err != nil {
return errors.Trace(err)
}
if k.Tp == etcd.CDCKeyTypeCapture || k.Tp == etcd.CDCKeyTypeOnwer {
if k.Tp == etcd.CDCKeyTypeCapture || k.Tp == etcd.CDCKeyTypeOwner {
return nil
}
if len(k.CaptureID) != 0 && k.CaptureID != s.CaptureID {
Expand Down
6 changes: 3 additions & 3 deletions pkg/etcd/etcdkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type CDCKeyType = int
// the types of etcd key
const (
CDCKeyTypeUnknown CDCKeyType = iota
CDCKeyTypeOnwer
CDCKeyTypeOwner
CDCKeyTypeCapture
CDCKeyTypeChangefeedInfo
CDCKeyTypeChangeFeedStatus
Expand Down Expand Up @@ -89,7 +89,7 @@ func (k *CDCKey) Parse(key string) error {
key = key[len(etcdKeyBase):]
switch {
case strings.HasPrefix(key, ownerKey):
k.Tp = CDCKeyTypeOnwer
k.Tp = CDCKeyTypeOwner
k.CaptureID = ""
k.ChangefeedID = ""
key = key[len(ownerKey):]
Expand Down Expand Up @@ -147,7 +147,7 @@ func (k *CDCKey) Parse(key string) error {

func (k *CDCKey) String() string {
switch k.Tp {
case CDCKeyTypeOnwer:
case CDCKeyTypeOwner:
if len(k.OwnerLeaseID) == 0 {
return etcdKeyBase + ownerKey
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/etcd/etcdkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func (s *etcdkeySuite) TestEtcdKey(c *check.C) {
}{{
key: "/tidb/cdc/owner/223176cb44d20a13",
expected: &CDCKey{
Tp: CDCKeyTypeOnwer,
Tp: CDCKeyTypeOwner,
OwnerLeaseID: "223176cb44d20a13",
},
}, {
key: "/tidb/cdc/owner",
expected: &CDCKey{
Tp: CDCKeyTypeOnwer,
Tp: CDCKeyTypeOwner,
OwnerLeaseID: "",
},
}, {
Expand Down

0 comments on commit 9ebcc08

Please sign in to comment.