Skip to content

Commit

Permalink
fix cdc (#1643)
Browse files Browse the repository at this point in the history
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and baurine committed Feb 28, 2024
1 parent de706b0 commit 3982c06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/utils/topology/ticdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import (

// TODO: refactor this with topology prefix since it is compatible with other components.
const (
ticdcTopologyKeyPrefix = "/tidb/cdc/"
ticdcCaptureKeyIdent = "__cdc_meta__/capture/"
ticdcTopologyKeyPrefix = "/topology/ticdc/"
)

func FetchTiCDCTopology(ctx context.Context, etcdClient *clientv3.Client) ([]TiCDCInfo, error) {
Expand All @@ -35,7 +34,7 @@ func FetchTiCDCTopology(ctx context.Context, etcdClient *clientv3.Client) ([]TiC
nodes := make([]TiCDCInfo, 0)
for _, kv := range resp.Kvs {
key := string(kv.Key)
if !strings.HasPrefix(key, ticdcTopologyKeyPrefix) || !strings.Contains(key, ticdcCaptureKeyIdent) {
if !strings.HasPrefix(key, ticdcTopologyKeyPrefix) {
continue
}

Expand Down

0 comments on commit 3982c06

Please sign in to comment.