Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiCDC mysql sink can not connect to ipv6 address #6135

Closed
overvenus opened this issue Jul 1, 2022 · 10 comments
Closed

TiCDC mysql sink can not connect to ipv6 address #6135

overvenus opened this issue Jul 1, 2022 · 10 comments
Assignees
Labels
affects-6.1 area/dm Issues or PRs related to DM. area/ticdc Issues or PRs related to TiCDC. component/sink Sink component. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@overvenus
Copy link
Member

What did you do?

Create a changefeed that replicate data to an ipv6 address MySQL server.

tiup cdc cli changefeed create --pd="http://[::1]:2379" --sink-uri="tidb://root:@[::1]:4005/" --changefeed-id="simple-replication-task" --sort-engine="unified" 

dsnStr := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s", username, password, hostName, port, params.tls)

We should use net.JoinHostPort for hostnames that are in literal IP addresses.

Workaround: use DNS domain name.

What did you expect to see?

Success.

What did you see instead?

Starting component cdc: /Users/.tiup/components/cdc/v6.1.0/cdc cli changefeed create --pd=http://[::1]:2379 --sink-uri=tidb://root:@[::1]:4005/ --changefeed-id=simple-replication-task --sort-engine=unified
Error: [CDC:ErrMySQLConnectionError]fail to open MySQL connection: dial tcp [::1:4005]:3306: connect: no route to host

Versions of the cluster

TiCDC version (execute cdc version):

v6.1.0
@overvenus overvenus added type/bug The issue is confirmed as a bug. component/sink Sink component. severity/moderate area/ticdc Issues or PRs related to TiCDC. labels Jul 1, 2022
@lance6716
Copy link
Contributor

please also consider fixing DM's usage

dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/?charset=utf8mb4&interpolateParams=true&maxAllowedPacket=0",

@3pointer
Copy link
Contributor

3pointer commented Jul 1, 2022

@Rustin170506
Copy link
Member

please also consider fixing DM's usage

dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/?charset=utf8mb4&interpolateParams=true&maxAllowedPacket=0",

The problem with dm might be that the user might pass ::1 instead of [::1], right?

@lance6716
Copy link
Contributor

please also consider fixing DM's usage

dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/?charset=utf8mb4&interpolateParams=true&maxAllowedPacket=0",

The problem with dm might be that the user might pass ::1 instead of [::1], right?

Maybe DM should support both type, I haven't take a look at IPv6 address format 😂

@Rustin170506
Copy link
Member

please also consider fixing DM's usage

dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/?charset=utf8mb4&interpolateParams=true&maxAllowedPacket=0",

The problem with dm might be that the user might pass ::1 instead of [::1], right?

Maybe DM should support both type, I haven't take a look at IPv6 address format 😂

::1 is not a valid address in DSN, but [::1] is.

@nongfushanquan
Copy link
Contributor

/label affect-6.1

@ti-chi-bot
Copy link
Member

@nongfushanquan: The label(s) affect-6.1 cannot be applied. These labels are supported: duplicate, bug-from-internal-test, bug-from-user, affects-4.0, affects-5.0, affects-5.1, affects-5.2, affects-5.3, affects-5.4, affects-6.0, affects-6.1, may-affects-4.0, may-affects-5.0, may-affects-5.1, may-affects-5.2, may-affects-5.3, may-affects-5.4, may-affects-6.0, may-affects-6.1, needs-cherry-pick-release-4.0, needs-cherry-pick-release-5.0, needs-cherry-pick-release-5.1, needs-cherry-pick-release-5.2, needs-cherry-pick-release-5.3, needs-cherry-pick-release-5.4, needs-cherry-pick-release-6.0, needs-cherry-pick-release-6.1, question, release-blocker, wontfix, require-LGT1, require-LGT3.

In response to this:

/label affect-6.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@nongfushanquan
Copy link
Contributor

/label affects-6.1

@D3Hunter
Copy link
Contributor

please also consider fixing DM's usage

dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/?charset=utf8mb4&interpolateParams=true&maxAllowedPacket=0",

The problem with dm might be that the user might pass ::1 instead of [::1], right?

Maybe DM should support both type, I haven't take a look at IPv6 address format 😂

::1 is not a valid address in DSN, but [::1] is.

square brackets are not part of the address, it part of the URI syntax. IPV6 address doesn't has square brackets.

A host identified by an Internet Protocol literal address, version 6
[RFC3513] or later, is distinguished by enclosing the IP literal
within square brackets ("[" and "]").

see https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2

@Rustin170506
Copy link
Member

square brackets are not part of the address, it part of the URI syntax. IPV6 address doesn't has square brackets.

Uh-huh, That's what I meant too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 area/dm Issues or PRs related to DM. area/ticdc Issues or PRs related to TiCDC. component/sink Sink component. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

7 participants