-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 _coordinating_only
for nodes resolving in nodes API
#30313
Add _coordinating_only
for nodes resolving in nodes API
#30313
Conversation
Add a filter `_coordinating_only` in nodes API to make it easier to get all the coordinating nodes, which are neither master, nor data, nor ingest nodes.
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.
The name _coordinating_only
seems too long to me. Maybe just _coordinating
? Other reviewers' opinions welcome.
@@ -102,9 +102,7 @@ public void testCoordinatorOnlyNodes() { | |||
.map(DiscoveryNode::getId) | |||
.toArray(String[]::new); | |||
|
|||
assertThat( |
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.
I think it'd be good to keep this assertion here too.
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.
Looks good now, thanks 👍
docs/reference/cluster.asciidoc
Outdated
@@ -9,13 +9,15 @@ | |||
Most cluster level APIs allow to specify which nodes to execute on (for | |||
example, getting the node stats for a node). Nodes can be identified in | |||
the APIs either using their internal node id, the node name, address, | |||
custom attributes, or just the `_local` node receiving the request. For | |||
custom attributes, or just the `_local`, `_master` or `_coordinating_only` nodes receiving the request. For |
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.
This doesn't make sense - _local
refers to the node receiving the request, but _master
and _coordinating_only
refer to all master and coordinating nodes. I think it might be better to expand this section of the docs with something like a bulleted list, since this sentence is becoming unwieldy.
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.
Hi @DaveCTurner, I just find this part a little bit confusing when we say "nodes to execute on"
or "node receiving the request"
. If I understand well, all the _local
, _master
, _coordinating_only
or node id, custom attributes etc. are just filters right ? When I do a GET /_nodes/_local
it returns to me the node info of the local node, if I do a GET /_nodes/_master
, it returns to me the node info of master node ? same for other api like nodes stats, nodes hot_threads etc. So if the local node is the master, I get the same result for the above 2 requests right ? What we would explain here is not "the node to which request was forwarded" ?
* - a node id | ||
* - a wild card pattern that will be matched against node names | ||
* - a "attr:value" pattern, where attr can be a node role (master, data, ingest etc.) in which case the value can be true of false | ||
* - a "attr:value" pattern, where attr can be a node role (master, data, ingest etc.) in which case the value can be true or false, |
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.
👍
Correction: reading the earlier discussion I see that we settled on |
Is it better to change it to the |
Pinging @elastic/es-core-infra |
Yes, I think this should follow the I can think of cases where wanting to say |
the problem with |
Yep:
|
maybe |
Hi, I update the PR and I see it should follow the |
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.
Looks good. There's one more code change to make and then it's just docs and the 6.4 changelog to update.
@@ -102,9 +102,7 @@ public void testCoordinatorOnlyNodes() { | |||
.map(DiscoveryNode::getId) | |||
.toArray(String[]::new); | |||
|
|||
assertThat( |
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.
Looks good now, thanks 👍
@@ -254,6 +262,13 @@ private static DiscoveryNode newNode(int nodeId, Map<String, String> attributes, | |||
Set<String> matchingNodeIds(DiscoveryNodes nodes) { | |||
return Collections.singleton(nodes.getMasterNodeId()); | |||
} | |||
}, COORDINATING_ONLY("_coordinating_only") { |
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.
This looks like a hangover of the previous approach - should be coordinating_only:true
I think.
Hi @DaveCTurner |
@elasticmachine test this please @PnPie I updated the changelog as this seemed simpler than describing how to do so :) Hope that's ok. I also merged |
test this please |
I'm tempted to suggest reverting the docs change - I never actually checked that the other options are documented, and they aren't (yet -- I opened #30455 for this) so your addition to the docs is not really necessary. WDYT? |
Okay, as anyway we are going to update the docs for all there, I can create a PR for that one if needed. So I'll revert it after the CI run. |
That'd be awesome, thanks. |
…elasticsearch into coordinating_only_nodes_resolving
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, thanks @PnPie
@elasticmachine test this please |
Today we can execute cluster API actions on only master, data or ingest nodes using the `master:true`, `data:true` and `ingest:true` filters, but it is not so easy to select coordinating-only nodes (i.e. those nodes that are neither master nor data nor ingest nodes). This change fixes this by adding support for a `coordinating_only` filter such that `coordinating_only:true` adds all coordinating-only nodes to the set of selected nodes, and `coordinating_only:false` deletes them. Resolves #28831.
…or-you * elastic/master: (22 commits) Docs: Test examples that recreate lang analyzers (elastic#29535) BulkProcessor to retry based on status code (elastic#29329) Add GET Repository High Level REST API (elastic#30362) add a comment explaining the need for RetryOnReplicaException on missing mappings Add `coordinating_only` node selector (elastic#30313) Stop forking groovyc (elastic#30471) Avoid setting connection request timeout (elastic#30384) Use date format in `date_range` mapping before fallback to default (elastic#29310) Watcher: Increase HttpClient parallel sent requests (elastic#30130) Mute ML upgrade test (elastic#30458) Stop forking javac (elastic#30462) Client: Deprecate many argument performRequest (elastic#30315) Docs: Use task_id in examples of tasks (elastic#30436) Security: Rename IndexLifecycleManager to SecurityIndexManager (elastic#30442) [Docs] Fix typo in cardinality-aggregation.asciidoc (elastic#30434) Avoid NPE in `more_like_this` when field has zero tokens (elastic#30365) Build: Switch to building javadoc with html5 (elastic#30440) Add a quick tour of the project to CONTRIBUTING (elastic#30187) Reindex: Use request flavored methods (elastic#30317) Silence SplitIndexIT.testSplitIndexPrimaryTerm test failure. (elastic#30432) ...
* master: Upgrade to Lucene-7.4-snapshot-6705632810 (#30519) add version compatibility from 6.4.0 after backport, see #30319 (#30390) Security: Simplify security index listeners (#30466) Add proper longitude validation in geo_polygon_query (#30497) Remove Discovery.AckListener.onTimeout() (#30514) Build: move generated-resources to build (#30366) Reindex: Fold "with all deps" project into reindex (#30154) Isolate REST client single host tests (#30504) Solve Gradle deprecation warnings around shadowJar (#30483) SAML: Process only signed data (#30420) Remove BWC repository test (#30500) Build: Remove xpack specific run task (#30487) AwaitsFix IntegTestZipClientYamlTestSuiteIT#indices.split tests LLClient: Add setJsonEntity (#30447) Expose CommonStatsFlags directly in IndicesStatsRequest. (#30163) Silence IndexUpgradeIT test failures. (#30430) Bump Gradle heap to 1792m (#30484) [docs] add warning for read-write indices in force merge documentation (#28869) Avoid deadlocks in cache (#30461) Test: remove hardcoded list of unconfigured ciphers (#30367) mute SplitIndexIT due to #30416 Docs: Test examples that recreate lang analyzers (#29535) BulkProcessor to retry based on status code (#29329) Add GET Repository High Level REST API (#30362) add a comment explaining the need for RetryOnReplicaException on missing mappings Add `coordinating_only` node selector (#30313) Stop forking groovyc (#30471) Avoid setting connection request timeout (#30384) Use date format in `date_range` mapping before fallback to default (#29310) Watcher: Increase HttpClient parallel sent requests (#30130) # Conflicts: # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java
* 6.x: Upgrade to Lucene-7.4-snapshot-6705632810 (#30519) Remove Discovery.AckListener.onTimeout() (#30514) Build: move generated-resources to build (#30366) Reindex: Fold "with all deps" project into reindex (#30154) Isolate REST client single host tests (#30504) Remove BWC repository test (#30500) Build: Remove xpack specific run task (#30487) AwaitsFix IntegTestZipClientYamlTestSuiteIT#indices.split tests LLClient: Add setJsonEntity (#30447) [docs] add warning for read-write indices in force merge documentation (#28869) Avoid deadlocks in cache (#30461) BulkProcessor to retry based on status code (#29329) Avoid setting connection request timeout (#30384) Test: remove hardcoded list of unconfigured ciphers (#30367) Add GET Repository High Level REST API (#30362) mute SplitIndexIT due to #30416 Docs: Test examples that recreate lang analyzers (#29535) add a comment explaining the need for RetryOnReplicaException on missing mappings Pass the task to broadcast actions (#29672) Stop forking groovyc (#30471) Add `coordinating_only` node selector (#30313) Fix accidental error in changelog Use date format in `date_range` mapping before fallback to default (#29310) Watcher: Increase HttpClient parallel sent requests (#30130) [Security][Tests] Azeri(Turkish) locale tripps opensaml dependency
Add a
_coordinating_only
filter in nodes API to make it easier to get all the coordinating nodes, which are neither master, nor data, nor ingest nodes.Close #28831