Enable IPv6 URIs in reindex from remote#36874
Conversation
Reindex from remote was using a custom regex to dermine what URIs were valid. This commit removes the custom regex and uses the java.net.URI class instead, allowing IPv6 support without changing the existing validation around a URI in reindex from remote.
|
Pinging @elastic/es-distributed |
ywelsch
left a comment
There was a problem hiding this comment.
Would it be possible to have a test that runs some actual reindex operations against ::1 if available?
| String pathPrefix = hostMatcher.group("pathPrefix"); | ||
| int port = Integer.parseInt(hostMatcher.group("port")); | ||
|
|
||
| String scheme = uri.getScheme(); |
There was a problem hiding this comment.
also check that scheme is not null in the above validation?
There was a problem hiding this comment.
| int port = Integer.parseInt(hostMatcher.group("port")); | ||
|
|
||
| String scheme = uri.getScheme(); | ||
| String host = uri.getHost(); |
There was a problem hiding this comment.
same for host, check that it's not null?
There was a problem hiding this comment.
Ill add a null host check in RestReindexActionTests, but the URI wont parse if its null, so I dont have to add any code here.
| int port = uri.getPort(); | ||
|
|
||
| String pathPrefix = null; | ||
| if (uri.getPath().isEmpty() == false) { |
There was a problem hiding this comment.
what if getPath returns null?
There was a problem hiding this comment.
there is an existing test that actually wants it to be null, so i wanted to keep that functionality. It used to return null in the regex, and now it was returning an empty string, so i kept the old functionality.
|
WRT testing |
Reindex from remote was using a custom regex to dermine what URIs were valid. This commit removes the custom regex and uses the java.net.URI class instead, allowing IPv6 support without changing the existing validation around a URI in reindex from remote.
* elastic/master: (539 commits) SQL: documentation improvements and updates (elastic#36918) [DOCS] Merges list of discovery and cluster formation settings (elastic#36909) Only compress responses if request was compressed (elastic#36867) Remove duplicate paragraph (elastic#36942) Fix URI to cluster stats endpoint on specific nodes (elastic#36784) Fix typo in unitTest task (elastic#36930) RecoveryMonitor#lastSeenAccessTime should be volatile (elastic#36781) [CCR] Add `ccr.auto_follow_coordinator.wait_for_timeout` setting (elastic#36714) Scripting: Remove deprecated params.ctx (elastic#36848) Refactor the REST actions to clarify what endpoints are deprecated. (elastic#36869) Add JDK 12 to CI rotation (elastic#36915) Improve error message for 6.x style realm settings (elastic#36876) Send clear session as routable remote request (elastic#36805) [DOCS] Remove redundant ILM attributes (elastic#36808) SQL: Fix bug regarding histograms usage in scripting (elastic#36866) Update index mappings when ccr restore complete (elastic#36879) Docs: Bump version to alpha2 after release Enable IPv6 URIs in reindex from remote (elastic#36874) Watcher: Remove unused local variable in doExecute (elastic#36655) [DOCS] Synchs titles of X-Pack APIs ...
Reindex from remote was using a custom regex to dermine what URIs were
valid. This commit removes the custom regex and uses the java.net.URI
class instead, allowing IPv6 support without changing the existing
validation around a URI in reindex from remote.