Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brpc already supports IPv6. Braft needed some changes to support it.
The main motivation to support IPv6 is operational simplicity. For instance, otherwise we need to know which IPv4 maps to which IPv6, and within IPv4 there's local IPs vs public IPs etc.
Working with Brpc endpoint for IPv6 is a little awkward, which is why this is more complicated than it needs to be. Btw, I haven't done C++ professionally for over 10 years, so feel free to suggest any code changes.
Fixes #376
Test plan:
Updated the Counter service to take an
--ip
parameter. Used that to pass in an IPv6 address, both [::1] and my actual IPv6 address.Ran Counter client.
Also, used
braft_cli
to transfer leaders to see if braft_cli was correctly parsing the config, which it did.