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

Adds cluster state size to /_cluster/state response #23440

Merged
merged 3 commits into from Mar 2, 2017

Conversation

@abeyad
Copy link
Contributor

commented Mar 1, 2017

This commit adds the size of the cluster state to the response for the
get cluster state API call (GET /_cluster/state). The size that is
returned is the size of the full cluster state in bytes when compressed.
This is the same size of the full cluster state when serialized to
transmit over the network. Specifying the ?human flag displays the
compressed size in a more human friendly manner. Note that even if the
cluster state request filters items from the cluster state (so a subset
of the cluster state is returned), the size that is returned is the
compressed size of the entire cluster state.

Closes #3415

Ali Beyad
Adds cluster state size to /_cluster/state response
This commit adds the size of the cluster state to the response for the
get cluster state API call (GET /_cluster/state).  The size that is
returned is the size of the full cluster state in bytes when compressed.
This is the same size of the full cluster state when serialized to
transmit over the network.  Specifying the ?human flag displays the
compressed size in a more human friendly manner.  Note that even if the
cluster state request filters items from the cluster state (so a subset
of the cluster state is returned), the size that is returned is the
compressed size of the entire cluster state.

Closes #3415
Ali Beyad
@jpountz
Copy link
Contributor

left a comment

I have a concern about the serialization logic.

if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED)) {
totalCompressedSize = new ByteSizeValue(in);
} else {
totalCompressedSize = new ByteSizeValue(serializeFullClusterState(clusterState, in.getVersion()).length());

This comment has been minimized.

Copy link
@jpountz

jpountz Mar 1, 2017

Contributor

I'm worried that this could slow down serialization significantly. Should we have a marker value instead that means the cluster state serialized size is unknown?

This comment has been minimized.

Copy link
@abeyad

abeyad Mar 2, 2017

Author Contributor

I'm good with that. I wasn't sure what the best course of action was to do here. We could just return 0 bytes in a mixed cluster environment; once all nodes are upgraded to the same version, this wouldn't be an issue anyway.

This comment has been minimized.

Copy link
@jpountz

jpountz Mar 2, 2017

Contributor

good point, agreed

@jpountz
jpountz approved these changes Mar 2, 2017
Copy link
Contributor

left a comment

LGTM

Ali Beyad

@abeyad abeyad merged commit 577d2a6 into elastic:master Mar 2, 2017

2 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details

@abeyad abeyad deleted the abeyad:cluster_state_size branch Mar 2, 2017

@abeyad

This comment has been minimized.

Copy link
Contributor Author

commented Mar 2, 2017

thanks for the review @jpountz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.