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

Add Cross Cluster Search support for scroll searches #25094

Merged
merged 19 commits into from
Jun 13, 2017

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Jun 7, 2017

To complete the cross cluster search capabilities for all search types and
function this change adds cross cluster search support for scroll searches.

To complete the cross cluster search capabilities for all search types and
function this change adds cross cluster search support for scroll searches.
@s1monw s1monw added :Search/Search Search-related issues that do not fall into other categories >enhancement v5.6.0 v6.0.0 labels Jun 7, 2017
@s1monw s1monw requested review from jpountz, javanna and jimczi June 7, 2017 07:59
s1monw added a commit to s1monw/elasticsearch that referenced this pull request Jun 8, 2017
In order to add scroll support for cross cluster search we need
to resolve the nodes encoded in the scroll ID to send requests to the
corresponding nodes. This change adds the low level connection infrastrucutre
that also ensures that connections are re-established if the cluster is
disconnected due to a network faiulre or restarts.

Relates to elastic#25094
@s1monw
Copy link
Contributor Author

s1monw commented Jun 8, 2017

FYI I broke out the connection infrastructure changes into a sep. PR to make this one smaller: #25123


import static org.elasticsearch.action.search.TransportSearchHelper.parseScrollId;

final class ClearScrollController implements Runnable {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I broke this class out of TransportClearScrollAction.java since I needed to add unittest for it. It was much easier to do that as a sep. class such that the transport action is really just passing on the request.

s1monw added a commit to s1monw/elasticsearch that referenced this pull request Jun 8, 2017
This change extracts the main logic from `TransportClearScrollAction`
into a new class `ClearScrollController` and adds a corresponding unittest.

Relates to elastic#25094
@s1monw
Copy link
Contributor Author

s1monw commented Jun 8, 2017

I took another intermediate step to make this smaller here: #25125
once the breakouts are in I merge this one up for simpler reviews.

s1monw added a commit that referenced this pull request Jun 8, 2017
This change extracts the main logic from `TransportClearScrollAction`
into a new class `ClearScrollController` and adds a corresponding unit test.

Relates to #25094
Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

The transport layer is a bit out of my comfort zone so don't trust my review too much, but I think that change makes sense to me.

@s1monw
Copy link
Contributor Author

s1monw commented Jun 8, 2017

The transport layer is a bit out of my comfort zone so don't trust my review too much, but I think that change makes sense to me.

@jpountz I opened #25123 for this to separate it out

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.

LGTM

} else {
try {
Transport.Connection connection = searchTransportService.getConnection(target.getClusterAlias(),
node);
Copy link
Member

Choose a reason for hiding this comment

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

I think that node); fits in the previous line

node);
searchTransportService.sendFreeContext(connection, target.getScrollId(),
ActionListener.wrap(freed -> onFreedContext(freed.isFreed()),
e -> onFailedFreedContext(e, node)));
Copy link
Member

Choose a reason for hiding this comment

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

I think this line fits in the previous one


- do:
search:
index: my_remote_cluster:test_index
Copy link
Member

Choose a reason for hiding this comment

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

maybe also scroll against local indices at the same time? That would complicate the test a bit though, maybe it's not worth it, not sure.

s1monw added a commit that referenced this pull request Jun 13, 2017
In order to add scroll support for cross cluster search we need
to resolve the nodes encoded in the scroll ID to send requests to the
corresponding nodes. This change adds the low level connection infrastructure
that also ensures that connections are re-established if the cluster is
disconnected due to a network failure or restarts.

Relates to #25094
s1monw added a commit that referenced this pull request Jun 13, 2017
In order to add scroll support for cross cluster search we need
to resolve the nodes encoded in the scroll ID to send requests to the
corresponding nodes. This change adds the low level connection infrastructure
that also ensures that connections are re-established if the cluster is
disconnected due to a network failure or restarts.

Relates to #25094
@s1monw
Copy link
Contributor Author

s1monw commented Jun 13, 2017

@javanna @jpountz I merged this up with master since all spinoffs are in. I think it's basically down to the essentials of this change. If you wanna take another look at it since it's must more contained now?

@s1monw s1monw merged commit bc7ec68 into elastic:master Jun 13, 2017
@s1monw s1monw deleted the scroll_cross_cluster branch June 13, 2017 15:22
s1monw added a commit that referenced this pull request Jun 13, 2017
This change extracts the main logic from `TransportClearScrollAction`
into a new class `ClearScrollController` and adds a corresponding unit test.

Relates to #25094
s1monw added a commit that referenced this pull request Jun 13, 2017
To complete the cross cluster search capabilities for all search types and
function this change adds cross cluster search support for scroll searches.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jun 14, 2017
* master: (27 commits)
  Refactor TransportShardBulkAction.executeUpdateRequest and add tests
  Make sure range queries are correctly profiled. (elastic#25108)
  Test: allow setting socket timeout for rest client (elastic#25221)
  Migration docs for elastic#25080 (elastic#25218)
  Remove `discovery.type` BWC layer from the EC2/Azure/GCE plugins elastic#25080
  When stopping via systemd only kill the JVM, not its control group (elastic#25195)
  Remove PrefixAnalyzer, because it is no longer used.
  Internal: Remove Strings.cleanPath (elastic#25209)
  Docs: Add note about which secure settings are valid (elastic#25212)
  Indices.rollover/10_basic should refresh to make the doc visible in lucene stats
  Port support for commercial GeoIP2 databases from Logstash. (elastic#24889)
  [DOCS] Add ML node to node.asciidoc (elastic#24495)
  expose simple pattern tokenizers (elastic#25159)
  Test: add setting to change request timeout for rest client (elastic#25201)
  Fix secure repository-hdfs tests on JDK 9
  Add target_field parameter to gsub, join, lowercase, sort, split, trim, uppercase (elastic#24133)
  Add Cross Cluster Search support for scroll searches (elastic#25094)
  Adapt skip version in rest-api-spec/test/indices.rollover/20_max_doc_condition.yml
  Rollover max docs should only count primaries (elastic#24977)
  Add remote cluster infrastructure to fetch discovery nodes. (elastic#25123)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v5.6.0 v6.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants