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
cli: IPv6-related fixes #38924
cli: IPv6-related fixes #38924
Conversation
b14b543
to
5c9ac90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 11 of 11 files at r1, 1 of 1 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @bdarnell and @knz)
pkg/base/store_spec.go, line 413 at r1 (raw file):
continue } addr, port, err := netutil.SplitHostPort(v, "")
Add a comment, it seems confusing that you'd split just to immediately join again.
pkg/util/netutil/addr.go, line 23 at r1 (raw file):
address that is provided
Also is this comment right? It looks like you require the []
now.
Prior to this patch, there was a complex dance of supported formats between the CLI-level handling of "flag variables" (`base.JoinListType`) an the config-level handling of "join addresses" (`server.parseGossipBootstrapResolvers`). Due to imperfections throughout this complexity, the logic was unable to handle IPv6 addresses properly. This patch fixes this as follows: - it factors the handling of the host/port split between the `--host`/`--listen-addr` and `--join` flags. This introduces a new `netutil.SplitHostPort` which is now used in lieu of `net.SplitHostPort` for command-line handling. - it checks the format of addresses (and normalizes them) upfront during command-line parsing of `--join`, instead of waiting until the list of boostrap resolvers is computed. - it simplifies the computation of bootstrap resolvers accordingly, changing the API to specify that `server.Config.JoinList` must now contain just one address per value. - it adds the missing unit tests at the various levels. Release note (cli change): CockroachDB now requires square brackets to specify IPv6 addresses in `--join`, `--host`, `--listen-addr` and similar flags, for example `--listen-addr=[::1]`. The syntax without square brackets had been deprecated since CockroachDB 2.1. Release note (bug fix): CockroachDB now recognizes IPv6 addresses properly in the `--join` flag.
Before: ``` CockroachDB node starting... client flags: /usr/bin/cockroach <client cmd> --host=2607:a600:124:755c::16:26257 ``` After: ``` CockroachDB node starting... client flags: /usr/bin/cockroach <client cmd> --host=[2607:a600:124:755c::16]:26257 ``` Release note: None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @bdarnell and @tbg)
pkg/base/store_spec.go, line 413 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
Add a comment, it seems confusing that you'd split just to immediately join again.
Done.
pkg/util/netutil/addr.go, line 23 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
address that is provided
Also is this comment right? It looks like you require the
[]
now.
Done.
TFYR! bors r+ |
@bdarnell should I backport? |
nvm it's a feature change so no backport |
Build succeeded |
Fixes #38882.