-
Notifications
You must be signed in to change notification settings - Fork 559
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
Support for Multiple Endpoints #1083
base: main
Are you sure you want to change the base?
Conversation
You can use several different loopback addresses together for the test and skip dealing with Dns/network interfaces. IPv4 has the entire 127.x.x.x range for this. |
208bb46
to
a5f6025
Compare
Thanks for the suggestion. I want to test also the non-loopback addresses. So, added test for loopback ipv4 and ipv6 |
3713e9e
to
8126dd1
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.
Pull Request Overview
This PR adds support for multiple endpoints through the --bind option by refactoring various modules to work with endpoint arrays instead of a single endpoint. Key changes include updating the configuration and validation functions (e.g. in Format.cs and Options.cs), adapting server initializations (e.g. in GarnetServer and StoreWrapper), and modifying test cases to use endpoint arrays.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/Garnet.test/GarnetServerConfigTests.cs | Adds a new test to validate multi-endpoint support. |
libs/common/Format.cs | Refactors endpoint parsing functions to return arrays and updates error messaging. |
libs/server/Metrics/Info/GarnetInfoMetrics.cs | Adjusts metrics retrieval to support multiple endpoints. |
libs/host/Configuration/OptionsValidators.cs, Options.cs | Updates configuration options for multiple endpoints. |
test/Garnet.test/TestUtils.cs | Updates test utilities to work with endpoint arrays. |
libs/server/Resp/PurgeBPCommand.cs, libs/server/Servers/ServerOptions.cs, libs/cluster/Server/... | Various updates to replace single endpoint properties with endpoint arrays. |
test/Garnet.test/UnixSocketTests.cs, GarnetClientTests.cs, benchmark/... | Adjusts tests and benchmarks to align with multi-endpoint changes. |
This all works, just a few notes (IMHO it would be reasonable to save them for a future PR):
|
05ca313
to
cef3bdc
Compare
I made a change to log the message instead of the stack trace for the first one. |
Unix socket and TCP socket at the same time was, I thought, the use case that first drove this feature. Would be useful to see what makes that harder than two TCP sockets. |
The original purpose of this PR was to fully support hostnames that could map to multiple interfaces when provided through the bind option. |
I think it should be as simple as creating another instance of |
2d53a7d
to
91c99bc
Compare
The reason I didn't try to do this all in one PR (the one that added support for unix socket) is that I don't have confident mental model for what sort of changes that could possibly entail and hoped that just like this PR does, someone who has much clearer picture of the cluster mode (and the current networking stack) would have stab at it instead (Thanks!). Glad to see it was as simple as making many |
e942f80
to
d208c8a
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.
Added some config-related comments...
7314751
to
7dd95ed
Compare
6d58f56
to
e08ebe6
Compare
This PR adds support for multiple endpoints through --bind option.