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
Make routing_nodes
an independent metric option in cluster state api
#10412
Conversation
I like it @lmenezes , thanks! Makes sense to keep bw comp in 1.x and still return |
+1 to this change, and yes i'd make it 2.0 only |
@clintongormley great! but for 2.0 only you mean making routing_table routing_table only, right? the routing_nodes as an independent metric could go on 1.X, right? :) |
@lmenezes thinking about it again... it's such an easy change for users to make in 1.6, that i'd be tempted to just go ahead and do it, ie make the change completely in 1.6. |
@clintongormley perfect for me. just thought it could be useful to have a smooth transition, where you could upgrade your nodes and have old behaviour, and then adapt your code on a cluster that already has this change. anyway, any of the alternatives work for me :) |
Hi @lmenezes I gave a final look at this, I wonder if we should add the same options to the Java api as well. We would need to add a |
@javanna makes sense. Will update the PR with this :) |
@javanna so, just had time to look into this... Does it really make sense to separate that for the Java API? On the REST API, routing_nodes and routing_table are 2 completely different entities(even though both are rendered from the same data) and returning them or not might make difference(bytes sent through the wire, and the process of iterating the routing table to built the json representation for each of them). On the Java API, the RoutingTable object has to be sent over the wire anyway, and the RoutingNodes is actually volatile and built on demand from the RoutingTable(https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/cluster/ClusterState.java#L134 and https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/cluster/ClusterState.java#L226-L232). So, unless I'm missing something, it would make no difference at all(except from offering the same options on both Java/REST API) being able to control that individually on the Java API, and likely also make it confusing since you cannot really offer RoutingNodes without offering RoutingTable. Makes sense? |
hey @lmenezes you are right, this makes perfect sense to me. The routing table is what gets serialized over the wire, routing nodes are built on demand when requested first based on the routing table. I will merge this as-is, thanks a lot for looking into this! |
Cluster state api returns both routing_table and routing_nodes sections whenever routing_table is requested. That is pretty much the same info, just grouped differently. This commit allows to differentiate between the two. Yet, routing_table still returns both for bw comp reasons. Closes elastic#10352 Closes elastic#10412
@javanna thank you for taking the time to merge this 👍 |
Merged, thanks a lot @lmenezes ! |
…hrough specific flag For bacwards compatibility reasons routing_nodes were previously printed out when routing_table was requested, together with the actual routing_table. Now they are printed out only when requests through `routing_nodes` flag. Relates to elastic#10412
routing_nodes
an independent metric option in cluster state api
closes #10352