Skip to content

Speedup computing cluster health#78969

Merged
martijnvg merged 2 commits intoelastic:masterfrom
martijnvg:speedup_computing_cluster_health
Oct 12, 2021
Merged

Speedup computing cluster health#78969
martijnvg merged 2 commits intoelastic:masterfrom
martijnvg:speedup_computing_cluster_health

Conversation

@martijnvg
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@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
Copy Markdown
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

:Core/Infra/Stats Statistics tracking and retrieval APIs >enhancement Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.16.0 v8.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants