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

Update docs for cluster API #30468

Merged
merged 13 commits into from
Aug 20, 2018
Merged

Conversation

PnPie
Copy link
Contributor

@PnPie PnPie commented May 8, 2018

What about this for node filters update ?

Relates to #30455

Add docs for some missing node filters.
@nik9000 nik9000 added >docs General docs changes :Core/Infra/REST API REST infrastructure and utilities labels May 8, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

the APIs either using their internal node id, the node name, address,
custom attributes, or just the `_local` node receiving the request. For
example, here are some sample executions of nodes info:
Most cluster level APIs allow to specify nodes (for example, getting
Copy link
Member

Choose a reason for hiding this comment

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

Can you add something to sentence to explain that specifying nodes limits the results to those nodes? At least, I think that is what specifying the node does here, but I'm no expect.

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

More examples is good, but I think we need a more detailed description of the logic in DiscoveryNodes#resolveNodes() too: it's a comma-separated list of selectors, where each selector is:

  • _local
  • _master
  • _all
  • a node id or name or IP address or hostname
  • a pattern (containing * wildcards) that matches node name/IP/hostname
  • attr:value where attr and value are patterns (containing * wildcards) that match node attributes and values
  • the filters {master,data,ingest,coordinating_only}:{true,false} which add/remove the selected nodes from the current set.

The selectors run in order: the {master,data,ingest,coordinating_only}:false options means that order is sometimes important.

Also, +1 to @nik9000's comment: I also think it'd be good to describe the effects of specifying a set of nodes in more detail.

GET /_nodes/node_name_goes_here
GET /_nodes/node_name_goes_*
# Attributes (set something like node.attr.rack: 2 in the config)
# Using built-in attributes (master, data, ingest or coordinating_only)
GET /_nodes/master:false,data:false,ingest:true
Copy link
Contributor

Choose a reason for hiding this comment

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

This is equivalent to the simpler GET /_nodes/ingest:true so I don't think we should have this.

@PnPie
Copy link
Contributor Author

PnPie commented May 10, 2018

Hi @nik9000 @DaveCTurner
I updated it according to your comments, what do you think of this ?

nik9000
nik9000 previously approved these changes May 10, 2018
Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

I left a minor thing. @DaveCTurner, what do you think?

custom attributes, or just the `_local` node receiving the request. For
example, here are some sample executions of nodes info:
Most cluster level APIs allow to specify nodes with `node filters`, these filters
limit the results to selected nodes for corresponding APIs.(For example, you can
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a space after the . and before the (?

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

I left a few more comments. I think we need to be a bit more precise in some places still, and there's some formatting nits.

More generally I'm wondering if this would be better-off moving to the common options section, with corresponding updates to the links.

Most cluster level APIs allow to specify nodes with `node filters`, these filters
limit the results to selected nodes for corresponding APIs. (For example, you can
find it in APIs like `Cluster State`, `Task Management` and all the Nodes API like
`Nodes States`, `Nodes Info` etc.)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that most cluster-level APIs allow us to specify a set of nodes - by my reckoning it's these:

  • Cluster Stats (via the (undocumented?) ?nodeId= parameter - could also do with fixing)
  • Nodes Stats
  • Nodes Info
  • Nodes Feature Usage
  • Task Management API
  • Nodes hot_threads

There are 13 subheadings in this section, and 6/13 is less than half. (I haven't dug through the code to confirm this so my numbers could be off). In any case it might not be more than half in future, so I think I'd prefer "some" to "most".

Also the things in backticks in this paragraph are not code so I don't think they should be formatted like this. The ones that refer to other pages would be better as links, and node filters is introducing a piece of terminology which we seem either to put in italics or else "in double quotes" depending on taste.

Also also Nodes States should probably be Nodes Stats, and the cluster state API doesn't seem to support a node filter as stated here.

Copy link
Contributor Author

@PnPie PnPie May 11, 2018

Choose a reason for hiding this comment

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

Yes that's right, the Cluster Stats API doesn't support node filters, in fact we can only add /nodes to filter the nodes part of the response but no further filtering for that.

@PnPie
Copy link
Contributor Author

PnPie commented May 11, 2018

Thanks so much for your review @nik9000 and @DaveCTurner, I address it and for moving to common options section, I'm wondering this node specification part is more specific or only for Cluster level APIs ? and in all the sub-listed apis under Cluster APIs, it is redirected here where the node filters is mentioned. So maybe it's better to keep it here inside Cluster APIs level ?

@DaveCTurner
Copy link
Contributor

Hi @PnPie, sorry for the radio silence recently. This is still on my radar.

So maybe it's better to keep it here inside Cluster APIs level ?

I'm inclined to agree. Let's leave it as it is now.

I started out on a review with some suggested wording fixes but it got quite long and I decided it'd be simpler to make the changes on the branch itself. I merged master and pushed 86c08f0 with my suggested changes. Please could you review this and modify as you see fit?

@PnPie
Copy link
Contributor Author

PnPie commented Jun 8, 2018

Hi @DaveCTurner
Thanks for the modification and pushing directly, I see the changes you made and it looks (of course) good to me ;)
just for this part: https://github.com/elastic/elasticsearch/pull/30468/files#diff-44f2668cbd91a37d448762ce4e50503eR30, do you think it's better to emphasize it's a custom attr:value and the value could be a pattern (as the 2 previous are also attr:value but pre-defined) ? cause I just feel the 5th one seems quite similar ? but to be honest I'm not good at documentation, so this looks great to me, and if you don't mind you can change it directly in the branch :)

@DaveCTurner DaveCTurner dismissed nik9000’s stale review June 14, 2018 07:55

There's been substantial changes since this review. Please could you take another look?

@DaveCTurner
Copy link
Contributor

@elasticmachine test this please

@DaveCTurner
Copy link
Contributor

@nik9000 could you give this a final check as it changed substantially since your approving review?

@javanna
Copy link
Member

javanna commented Aug 16, 2018

ping @nik9000 can you check this one please?

@DaveCTurner
Copy link
Contributor

Perhaps @ywelsch too/instead? The story here is that @PnPie and I both contributed quite a few changes here so it's improper for me to approve and merge alone.

@DaveCTurner
Copy link
Contributor

@elasticmachine test this please

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

I've left a minor comment (probably just because I got a little confused), looks good otherwise.

* `_local`, to add the local node to the subset.
* `_master`, to add the currently-elected master node to the subset.
* a node id, to add this node to the set.
* a pattern, using `*` wildcards, which adds all nodes to the subset
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this a little bit confusing. It suggests that name, address, or hostname will only be resolved when using wildcards. Maybe change the previous entry (a node id) to say a node id, node name, address or hostname to add the node with the corresponding id, name, address or hostname to the set to reinforce that exact matching also works.

@DaveCTurner
Copy link
Contributor

Good point, thanks. A pattern with no * is still technically a pattern, but the wording is unclear.

@elasticmachine test this please, one last time 🤞

@DaveCTurner DaveCTurner merged commit a883e7d into elastic:master Aug 20, 2018
DaveCTurner added a commit that referenced this pull request Aug 20, 2018
Expands and clarifies exactly what is and isn't allowed when specifying a
subset of the nodes as targets of a cluster API, and adds missing links to this
from the hot threads and cluster stats API docs.

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Yu <yu.liu003@gmail.com>
DaveCTurner added a commit that referenced this pull request Aug 20, 2018
Expands and clarifies exactly what is and isn't allowed when specifying a
subset of the nodes as targets of a cluster API, and adds missing links to this
from the hot threads and cluster stats API docs.

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Yu <yu.liu003@gmail.com>
DaveCTurner added a commit that referenced this pull request Aug 20, 2018
Expands and clarifies exactly what is and isn't allowed when specifying a
subset of the nodes as targets of a cluster API, and adds missing links to this
from the hot threads and cluster stats API docs.

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Yu <yu.liu003@gmail.com>
jasontedor added a commit that referenced this pull request Aug 20, 2018
* master:
  Generalize remote license checker (#32971)
  Trim translog when safe commit advanced (#32967)
  Fix an inaccuracy in the dynamic templates documentation. (#32890)
  Logging: Use settings when building daemon threads (#32751)
  All Translog inner closes should happen after tragedy exception is set (#32674)
  HLREST: AwaitsFix ML Test
  Pass DiscoveryNode to initiateChannel (#32958)
  Add mzn and dz to unsupported locales (#32957)
  Use settings from the context in BootstrapChecks (#32908)
  Update docs for node specifications (#30468)
  HLRC: Forbid all Elasticsearch logging infra (#32784)
  Only configure publishing if it's applied externally (#32351)
  Fixes libs:dissect when in eclipse
  Protect ScriptedMetricIT test cases against failures on 0-doc shards (#32959) (#32968)
  [Kerberos] Add documentation for Kerberos realm (#32662)
  Watcher: Properly find next valid date in cron expressions (#32734)
  Fix some small issues in the getting started docs (#30346)
  Set forbidden APIs target compatibility to compiler java version   (#32935)
  Move connection listener to ConnectionManager (#32956)
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Aug 21, 2018
…e-types

* elastic/master: (89 commits)
  Fix assertion in AbstractSimpleTransportTestCase (elastic#32991)
  [DOC] Splits role mapping APIs into separate pages (elastic#32797)
  HLRC: ML Close Job (elastic#32943)
  Generalize remote license checker (elastic#32971)
  Trim translog when safe commit advanced (elastic#32967)
  Fix an inaccuracy in the dynamic templates documentation. (elastic#32890)
  Logging: Use settings when building daemon threads (elastic#32751)
  All Translog inner closes should happen after tragedy exception is set (elastic#32674)
  HLREST: AwaitsFix ML Test
  Pass DiscoveryNode to initiateChannel (elastic#32958)
  Add mzn and dz to unsupported locales (elastic#32957)
  Use settings from the context in BootstrapChecks (elastic#32908)
  Update docs for node specifications (elastic#30468)
  HLRC: Forbid all Elasticsearch logging infra (elastic#32784)
  Only configure publishing if it's applied externally (elastic#32351)
  Fixes libs:dissect when in eclipse
  Protect ScriptedMetricIT test cases against failures on 0-doc shards (elastic#32959) (elastic#32968)
  [Kerberos] Add documentation for Kerberos realm (elastic#32662)
  Watcher: Properly find next valid date in cron expressions (elastic#32734)
  Fix some small issues in the getting started docs (elastic#30346)
  ...
jasontedor pushed a commit that referenced this pull request Aug 21, 2018
Expands and clarifies exactly what is and isn't allowed when specifying a
subset of the nodes as targets of a cluster API, and adds missing links to this
from the hot threads and cluster stats API docs.

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Yu <yu.liu003@gmail.com>
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Aug 24, 2018
* commit '9088d811ce9cff922e6ef1befbeb0f1e0c27016a': (23 commits)
  Generalize remote license checker (elastic#32971)
  Trim translog when safe commit advanced (elastic#32967)
  Fix an inaccuracy in the dynamic templates documentation. (elastic#32890)
  HLREST: AwaitsFix ML Test
  Make Geo Context Mapping Parsing More Strict (elastic#32862)
  Add mzn and dz to unsupported locales (elastic#32957)
  Use settings from the context in BootstrapChecks (elastic#32908)
  Update docs for node specifications (elastic#30468)
  HLRC: Forbid all Elasticsearch logging infra (elastic#32784)
  Fix use of deprecated apis
  Only configure publishing if it's applied externally (elastic#32351)
  Protect ScriptedMetricIT test cases against failures on 0-doc shards (elastic#32959) (elastic#32968)
  Scripted metric aggregations: add deprecation warning and system (elastic#32944)
  Watcher: Properly find next valid date in cron expressions (elastic#32734)
  Fix some small issues in the getting started docs (elastic#30346)
  Set forbidden APIs target compatibility to compiler java version   (elastic#32935)
  [TEST] Add "ne" as an unsupported SimpleKdc locale (elastic#32700)
  MINOR: Remove `IndexTemplateFilter` (elastic#32841) (elastic#32974)
  INGEST: Create Index Before Pipeline Execute (elastic#32786) (elastic#32975)
  NETWORKING: Make RemoteClusterConn. Lazy Resolve DNS (elastic#32764) (elastic#32976)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/REST API REST infrastructure and utilities >docs General docs changes v6.3.3 v6.4.1 v6.5.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants