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

Speedup computing cluster health #78969

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

martijnvg
Copy link
Member

In cases the status is not GREEN.

Instead of building a list of all shard routings and
then counting the total and active number of shards,
use the RoutingNodes (which should already be built)
that can compute these numbers almost for free.

Relates to #77466

In cases the status is not GREEN.

Instead of building a list of all shard routings and
then counting the total and active number of shards,
use the RoutingNodes (which should already be built)
that can compute these numbers almost for free.

Relates to elastic#77466
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

One thing to fix, otherwise this looks fine to me

if (shard.relocating()) {
if (shard.active()) {
activeShardCount++;
} else if (shard.relocating()) {
Copy link
Member

Choose a reason for hiding this comment

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

This is not correct. A relocating shard is also active. We must not use else if here but just if.

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM

@martijnvg martijnvg merged commit 79542a9 into elastic:master Oct 12, 2021
martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Oct 12, 2021
In cases the status is not GREEN.

Instead of building a list of all shard routings and
then counting the total and active number of shards,
use the RoutingNodes (which should already be built)
that can compute these numbers almost for free.

Relates to elastic#77466
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
7.x

elasticsearchmachine pushed a commit that referenced this pull request Oct 12, 2021
In cases the status is not GREEN.

Instead of building a list of all shard routings and
then counting the total and active number of shards,
use the RoutingNodes (which should already be built)
that can compute these numbers almost for free.

Relates to #77466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Stats Statistics tracking and retrieval APIs >enhancement Team:Data Management Meta label for data/management team v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants