-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
pkg/types: Support Unix sockets in NewURLS #12469
Conversation
Etcd is a distributed key-vaule store databaes, Means that this is a system composed of multiple network servers, which must be non-stand-alone communication. This is in conflict with unix socket. I don't think unix socket is necessary. |
Thank you for your work on this. I have a need for this in an embedded etcd backup validation service. It would be a huge help in that context when validating multiple backups at once. |
There's two things we need to remember.
|
@@ -29,9 +29,6 @@ func TestValidateURLsValueBad(t *testing.T) { | |||
// bad port specification | |||
"127.0.0.1:foo", | |||
"127.0.0.1:", | |||
// unix sockets not supported | |||
"unix://", | |||
"unix://tmp/etcd.sock", |
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.
On the other hand, can you add the valid UDS URL test cases to TestNewURLsValue
?
On purpose: This would help with etcd e2e tests behaviorEtcd extensively uses unix:// communication in 'e2e' tests. The consequence of On exact supported syntax (grpc naming scheme ?)Does it mean etcd will start to support exact syntax of grpc Dial for unix:// namespace:
Warning: It might be subtle in terms of backward compatiblityIf so, as I mentioned in kubernetes/kubernetes#97257 (comment), I have some doubts about backward compatiblity of this change. Is https://github.com/grpc/grpc/blob/master/doc/naming.md suggests that "unix://127.0.0.5:1456" would be considered an absolute path, so put 127.0.0.5:1456 in the root directory:
|
The grpc spec said "there will actually be three slashes" for the path to be considered as an absolute path, so I agree that we need more unit tests to verify the syntax and backwards compatibility concerns. |
Not entirely sure why tests have failed for this PR, since I only added more unit testing and rebased it since last they ran. |
So this is kind of a 'third' format: officially not supported (documented) by grpc (as it has 2 slashes, so neither 0 nor 3) ,
Please also run:
to trigger the re-testing. |
In #12671 the test is related: that shows mapping between legacy "etcd" naming and grpc supported names. @trawler -> Please rebase (that will also retrigger tests) to get attention to this PR. |
done |
I played a little bit with the fix, to migrate all etcd integration tests to use
For now I decided to workaround the 'test-sockets' location problem by changing the working directory of the test execution.To declare support for such URLs, I think we need to have a dedicated testcase, e.g. in
|
Codecov Report
@@ Coverage Diff @@
## master #12469 +/- ##
===========================================
+ Coverage 48.88% 69.63% +20.74%
===========================================
Files 378 413 +35
Lines 30871 32087 +1216
===========================================
+ Hits 15092 22343 +7251
+ Misses 13814 7822 -5992
+ Partials 1965 1922 -43
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
Not stale, but does have a conflict now, re @trawler |
rebased against upstream/main |
@ptabor can you approve the workflows for this PR? |
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.
lgtm
Would be great if we could add some e2e tests(could be in separate PR). For example add more cases to those https://github.com/etcd-io/etcd/blob/main/tests/e2e/ctl_v3_grpc_test.go |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
This is still relevant. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
Still relevant. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
Sorry for the late response. Could you rebase this PR again although there is no any conflict? @trawler |
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.
LGTM Thank you @trawler
But I'd suggest to add some e2e test cases just as @serathius pointed out, which of course can be addressed in a separate PR.
Resolves #12450
This commits adds support to unix/unixs socket URLs, which currently
fail with the message "URL address does not have the form "host:port".
It also replaces the work started in #11747.