Skip to content
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

NETWORKING: http.publish_host Should Contain CNAME #32806

Merged
merged 12 commits into from Sep 12, 2018

Conversation

original-brownbear
Copy link
Member

@original-brownbear original-brownbear commented Aug 13, 2018

@original-brownbear original-brownbear added >bug WIP :Distributed/Network Http and internode communication implementations v7.0.0 v6.5.0 labels Aug 13, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion with @elastic/es-clients we need to take a more careful approach here as this change will break some of the official language clients. Instead, we should:

  • in 6.x we will retain the current behavior of not including the hostname in the publish address
  • however, we will deprecation warn if the publish address would include the hostname with the behavior that we are proposing in NETWORKING: http.publish_host Should Contain CNAME #32806
  • in 6.x we will introduce a system property that will enable users that want the hostname in the publish address to do so by using this system property; this system property can only be set to true and not to false as the system property is unneeded if the user wants to retain the current behavior
  • in 7.0.0 we will change the behavior to include the hostname in the publish address (if available)
  • in 7.x we can deprecation warn that the system property no longer has any impact

@original-brownbear
Copy link
Member Author

@jasontedor sounds good :) => on it :)

@original-brownbear
Copy link
Member Author

@jasontedor done I think, implemented the 6.x behavior here now. I guess the 7.0 change goes into a separate PR right?

@jasontedor jasontedor requested review from Tim-Brooks and removed request for jasontedor September 8, 2018 02:43
@jasontedor jasontedor dismissed their stale review September 8, 2018 02:44

Transferring review ownership to @tbrooks8

Copy link
Contributor

@Tim-Brooks Tim-Brooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with the behavior we are looking for here. But this looks alright to me in regards to the API response / deprecation.

However, it is trivial to make it have some weird behavior in regards to IPv6.

public void testCorrectDisplayPublishedIpv6() throws Exception {
        InetAddress localhost = InetAddress.getByName(NetworkAddress.format(InetAddress.getByName("0:0:0:0:0:0:0:1")));
        int port = 9200;
        assertPublishAddress(
            new HttpInfo(
                new BoundTransportAddress(
                    new TransportAddress[]{new TransportAddress(localhost, port)},
                    new TransportAddress(localhost, port)
                ), 0L, true
            ), NetworkAddress.format(localhost) + ':' + port
        );
    }

org.junit.ComparisonFailure: expected:<[::1]:9200> but was:<[0:0:0:0:0:0:0:1/[::1]]:9200>

Are we okay that IPv6 address will be in the host string section if the comparison fails due to address compression?

@jasontedor

I don't see an easy fix for that. We could always add like a new field for v7.0. But that introduces some backwards compatibility work.

@original-brownbear
Copy link
Member Author

@tbrooks8 fixed the test case you pointed out now :) We already had a utility method (probably copied from Guava) that can identify whether or not a String is a valid IP (4 and 6) => just used that => works fine :)

Copy link
Contributor

@Tim-Brooks Tim-Brooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@original-brownbear
Copy link
Member Author

@tbrooks8 thanks!

@original-brownbear original-brownbear merged commit 94cdf0c into elastic:master Sep 12, 2018
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Sep 12, 2018
* Follow up to elastic#32806 setting the setting to true for 7.x
jasontedor added a commit to martijnvg/elasticsearch that referenced this pull request Sep 12, 2018
* master: (43 commits)
  [HLRC][ML] Add ML put datafeed API to HLRC (elastic#33603)
  Update AWS SDK to 1.11.406  in repository-s3 (elastic#30723)
  Expose CCR stats to monitoring (elastic#33617)
  [Docs] Update match-query.asciidoc (elastic#33610)
  TEST: Adjust rollback condition when shard is empty
  [CCR] Improve shard follow task's retryable error handling (elastic#33371)
  Forbid negative `weight` in Function Score Query (elastic#33390)
  Clarify context suggestions filtering and boosting (elastic#33601)
  Disable CCR REST endpoints if CCR disabled (elastic#33619)
  Lower version on full cluster restart settings test
  Upgrade remote cluster settings (elastic#33537)
  NETWORKING: http.publish_host Should Contain CNAME (elastic#32806)
  Add test coverage for global checkpoint listeners
  Reset replica engine to global checkpoint on promotion (elastic#33473)
  HLRC: ML Delete Forecast API (elastic#33526)
  Remove debug logging in full cluster restart tests (elastic#33612)
  Expose CCR to the transport client (elastic#33608)
  Mute testIndexDeletionWhenNodeRejoins
  SQL: Make Literal a NamedExpression (elastic#33583)
  [DOCS] Adds missing built-in user information (elastic#33585)
  ...
jasontedor added a commit to martijnvg/elasticsearch that referenced this pull request Sep 12, 2018
* master: (128 commits)
  [HLRC][ML] Add ML put datafeed API to HLRC (elastic#33603)
  Update AWS SDK to 1.11.406  in repository-s3 (elastic#30723)
  Expose CCR stats to monitoring (elastic#33617)
  [Docs] Update match-query.asciidoc (elastic#33610)
  TEST: Adjust rollback condition when shard is empty
  [CCR] Improve shard follow task's retryable error handling (elastic#33371)
  Forbid negative `weight` in Function Score Query (elastic#33390)
  Clarify context suggestions filtering and boosting (elastic#33601)
  Disable CCR REST endpoints if CCR disabled (elastic#33619)
  Lower version on full cluster restart settings test
  Upgrade remote cluster settings (elastic#33537)
  NETWORKING: http.publish_host Should Contain CNAME (elastic#32806)
  Add test coverage for global checkpoint listeners
  Reset replica engine to global checkpoint on promotion (elastic#33473)
  HLRC: ML Delete Forecast API (elastic#33526)
  Remove debug logging in full cluster restart tests (elastic#33612)
  Expose CCR to the transport client (elastic#33608)
  Mute testIndexDeletionWhenNodeRejoins
  SQL: Make Literal a NamedExpression (elastic#33583)
  [DOCS] Adds missing built-in user information (elastic#33585)
  ...
original-brownbear added a commit that referenced this pull request Sep 18, 2018
* Follow up to #32806 setting the setting to true for 7.x
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Nov 22, 2018
* NETWORKING: http.publish_host Should Contain CNAME

* Closes elastic#22029
original-brownbear added a commit that referenced this pull request Nov 22, 2018
* NETWORKING: http.publish_host Should Contain CNAME

* Closes #22029
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
andrershov pushed a commit to andrershov/elasticsearch that referenced this pull request Aug 15, 2019
andrershov pushed a commit to andrershov/elasticsearch that referenced this pull request Aug 15, 2019
andrershov pushed a commit that referenced this pull request Aug 16, 2019
This commit adds CNAME reporting for transport.publish_address same way
it's done for http.publish_address.

Relates #32806
Relates #39970
andrershov pushed a commit that referenced this pull request Aug 16, 2019
This commit adds CNAME reporting for transport.publish_address same way
it's done for http.publish_address.

Relates #32806
Relates #39970

(cherry picked from commit e0a2558)
andrershov pushed a commit that referenced this pull request Aug 22, 2019
Follow up on #32806.

The system property es.http.cname_in_publish_address is deprecated
starting from 7.0.0 and deprecation warning should be added if the
property is specified.
This commit goes to 7.x and master.
Follow-up PR to remove es.http.cname_in_publish_address property
completely will go to the master.
andrershov pushed a commit that referenced this pull request Aug 22, 2019
Follow up on #32806.

The system property es.http.cname_in_publish_address is deprecated
starting from 7.0.0 and deprecation warning should be added if the
property is specified.
This PR will go to 7.x and master.
Follow-up PR to remove es.http.cname_in_publish_address property
completely will go to the master.

(cherry picked from commit a5ceca7)
jkakavas pushed a commit to jkakavas/elasticsearch that referenced this pull request Aug 22, 2019
…5616)

Follow up on elastic#32806.

The system property es.http.cname_in_publish_address is deprecated
starting from 7.0.0 and deprecation warning should be added if the
property is specified.
This PR will go to 7.x and master.
Follow-up PR to remove es.http.cname_in_publish_address property
completely will go to the master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Network Http and internode communication implementations v6.6.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should http.publish_host resolve the CNAME configured.
5 participants