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 Sort By Shard Count and Failed Shard Count to Get Snapshots API #77011

Conversation

original-brownbear
Copy link
Member

It's in the title. As requested by the Kibana team, adding these two additional sort columns.

It's in the title. As requested by the Kibana team, adding these two additional sort columns.
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Aug 30, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@arteam arteam self-requested a review August 30, 2021 08:41
Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

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

LGTM, I've left a couple of docs/naming comments.

Sort snapshots by the number of shards they contain and break ties by snapshot name.

`failed_shards_count`::
Sort snapshots by the number of shards that they failed to snapshot break ties by snapshot name.
Copy link
Contributor

Choose a reason for hiding this comment

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

that they failed to snapshot

I believe they is redundant here: the number of shards that failed to snapshot sounds more natural to me.

failed to snapshot break ties by snapshot name

I guess and is missed here: failed to snapshot and break ties by snapshot name

@@ -120,6 +120,12 @@ Allows setting a sort order for the result. Defaults to `start_time`, i.e. sorti

`index_count`::
Sort snapshots by the number of indices they contain and break ties by snapshot name.

`shard_count`::
Copy link
Contributor

Choose a reason for hiding this comment

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

General comment: I'm not sure if the parameter names are set in stone, but I think it's inconsistent that shard_count is singular and failed_shards_count is plural. E.g. we refer to shard_count in the codebase as SHARDS and SHARDS_COUNT, but in the external API it's shard_count.

Copy link
Member Author

Choose a reason for hiding this comment

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

++ that makes good sense, I made the external parameter failed_shard_count now to make it consistent. I think the enum/internal names are ok as is and we wouldn't really want to change them at this point for BwC reasons (at least technically the transport client would have its API broken otherwise).

@original-brownbear
Copy link
Member Author

Thanks Henning + Artem!

@original-brownbear original-brownbear merged commit 48f3784 into elastic:master Aug 30, 2021
@original-brownbear original-brownbear deleted the support-sort-by-shard-counts branch August 30, 2021 11:39
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Aug 30, 2021
…lastic#77011)

It's in the title. As requested by the Kibana team, adding these two additional sort columns.

relates elastic#74350
original-brownbear added a commit that referenced this pull request Aug 30, 2021
…77011) (#77018)

It's in the title. As requested by the Kibana team, adding these two additional sort columns.

relates #74350
@original-brownbear original-brownbear restored the support-sort-by-shard-counts branch April 18, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.16.0 v8.0.0-alpha2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants