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

Fix remote cluster seeds fallback #34090

Merged
merged 3 commits into from
Sep 27, 2018

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Sep 26, 2018

Recently we introduced the settings cluster.remote to take the place of search.remote for configuring remote cluster connections. We made this change due to the fact that we have generalized the remote cluster infrastructure to also be used within cross-cluster replication and not only cross-cluster search. For backwards compatibility, when we made this change, we allowed that cluster.remote would fallback to search.remote. Alas, the initial change for this contained a bug for handling the proxy and seeds settings. The bug for the seeds settings arose because we were manually iterating over the concrete settings only for cluster.remote seeds but not for search.remote seeds. This commit addresses this by iterating over both cluster.remote seeds and search.remote seeds. Additionally, when checking for existence of proxy settings, we have to not only check cluster.remote proxy settings, but also fallback to search.remote proxy settings. This commit addresses both issues, and adds tests for these situations.

Relates #33413

Recently we introduced the settings cluster.remote to take the place of
search.remote for confriguring remote cluster connections. We made this
change due to the fact that we have generalized the remote cluster
infrastructure to also be used within cross-cluster replication and not
only cross-cluster search. For backwards compatbility, when we made this
change, we allowed that cluster.remote would fallback to
search.remote. Alas, the initial change for this contained a bug for
handlings the proxy and seeds settings. The bug for the seeds settings
arose because we were manually iterating over the concrete settings only
for cluster.remote seeds but not for search.remote seeds. This commit
addresses this by iterating over both cluster.remote seeds and
search.remote seeds. Additionally, when checking for existence of proxy
settings, we have to not only check cluster.remote proxy settings, but
also fallback to search.remote proxy settings. This commit addresses
both issues, and adds tests for these situations.
@jasontedor jasontedor added >non-issue review :Search/Search Search-related issues that do not fall into other categories v7.0.0 v6.5.0 labels Sep 26, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

left a question, LGTM either way. Thanks for fixing!

// sort the intersection for predictable output order
final NavigableSet<String> intersection =
new TreeSet<>(Arrays.asList(
searchRemoteSeeds.keySet().stream().filter(s -> remoteSeeds.keySet().contains(s)).sorted().toArray(String[]::new)));
Copy link
Member

Choose a reason for hiding this comment

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

would accepting only one or the other simplify things a bit? I guess there is no reason to use the new setting and the deprecated one at the same time?

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that in the immediate next line, we reject duplicates. That is, we only accept one of search.remote.<cluster_alias>.seeds and cluster.remote.<cluster_alias>.seeds for a given cluster_alias.

Copy link
Member

Choose a reason for hiding this comment

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

I noticed that but it seems that you can still use the two settings at the same time, say one for a cluster and the other for another cluster. Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes; and that strikes me as okay so that we can support existing configurations, and users can add or migrate clusters to the new settings one at a time.

…fallback

* elastic/master:
  TEST: Add engine is closed as expected failure msg
  Adjust bwc version for max_seq_no_of_updates
  Build DocStats from SegmentInfos in ReadOnlyEngine (elastic#34079)
  When creating wildcard queries, use MatchNoDocsQuery when the field type doesn't exist. (elastic#34093)
  [DOCS] Moves graph to docs folder (elastic#33472)
  Mute MovAvgIT#testHoltWintersNotEnoughData
  Security: use default scroll keepalive (elastic#33639)
  Calculate changed roles on roles.yml reload (elastic#33525)
  Scripting: Reflect factory signatures in painless classloader (elastic#34088)
  XContentBuilder to handle BigInteger and BigDecimal (elastic#32888)
  Delegate wildcard query creation to MappedFieldType. (elastic#34062)
  Painless: Cleanup Cache (elastic#33963)
@jasontedor
Copy link
Member Author

@elasticmachine run gradle build tests

@jasontedor jasontedor merged commit 899a7c7 into elastic:master Sep 27, 2018
jasontedor added a commit that referenced this pull request Sep 27, 2018
Recently we introduced the settings cluster.remote to take the place of
search.remote for configuring remote cluster connections. We made this
change due to the fact that we have generalized the remote cluster
infrastructure to also be used within cross-cluster replication and not
only cross-cluster search. For backwards compatibility, when we made this
change, we allowed that cluster.remote would fallback to
search.remote. Alas, the initial change for this contained a bug for
handling the proxy and seeds settings. The bug for the seeds settings
arose because we were manually iterating over the concrete settings only
for cluster.remote seeds but not for search.remote seeds. This commit
addresses this by iterating over both cluster.remote seeds and
search.remote seeds. Additionally, when checking for existence of proxy
settings, we have to not only check cluster.remote proxy settings, but
also fallback to search.remote proxy settings. This commit addresses
both issues, and adds tests for these situations.
@jasontedor jasontedor deleted the fix-search-remote-fallback branch September 27, 2018 16:22
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Sep 27, 2018
* master: (25 commits)
  [DOCS] Synchronize location of Breaking Changes (elastic#33588)
  [DOCS] Synchronizes captialization in top-level titles (elastic#33605)
  [SQL] Clean up LogicalPlanBuilder#doJoin (elastic#34048)
  Fix remote cluster seeds fallback (elastic#34090)
  [ML][HLRC] Replace REST-based ML test cleanup with the ML client (elastic#34109)
  Handle MatchNoDocsQuery in span query wrappers (elastic#34106)
  Update MovAvgIT AwaitsFix bug url
  Bad regex in CORS settings should throw a nicer error (elastic#34035)
  [HLRC] Support for role mapper expression dsl (elastic#33745)
  Watcher: Reduce script cache churn by checking for mustache tags (elastic#33978)
  Fold EngineSearcher into Engine.Searcher (elastic#34082)
  Mute SpanMultiTermQueryBuilderTests#testToQuery
  TESTS: Enable DEBUG Logging in Flaky Test (elastic#34091)
  TEST: Add engine is closed as expected failure msg
  Adjust bwc version for max_seq_no_of_updates
  Build DocStats from SegmentInfos in ReadOnlyEngine (elastic#34079)
  When creating wildcard queries, use MatchNoDocsQuery when the field type doesn't exist. (elastic#34093)
  [DOCS] Moves graph to docs folder (elastic#33472)
  Mute MovAvgIT#testHoltWintersNotEnoughData
  Security: use default scroll keepalive (elastic#33639)
  ...
kcm pushed a commit that referenced this pull request Oct 30, 2018
Recently we introduced the settings cluster.remote to take the place of
search.remote for configuring remote cluster connections. We made this
change due to the fact that we have generalized the remote cluster
infrastructure to also be used within cross-cluster replication and not
only cross-cluster search. For backwards compatibility, when we made this
change, we allowed that cluster.remote would fallback to
search.remote. Alas, the initial change for this contained a bug for
handling the proxy and seeds settings. The bug for the seeds settings
arose because we were manually iterating over the concrete settings only
for cluster.remote seeds but not for search.remote seeds. This commit
addresses this by iterating over both cluster.remote seeds and
search.remote seeds. Additionally, when checking for existence of proxy
settings, we have to not only check cluster.remote proxy settings, but
also fallback to search.remote proxy settings. This commit addresses
both issues, and adds tests for these situations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories v6.5.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants