Skip to content

Conversation

@HiDAl
Copy link

@HiDAl HiDAl commented Feb 24, 2023

create all the machinery to have the shard limits information from the master node. Later, these values will be used by the new shard limits health indicator.

  • adds a new ShardLimitsMetadata object to be filled up by the master node and used by the designed health-node
  • wire up the listeners for changes of shard limits-related settings

issue #91119

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @HiDAl, I've created a changelog YAML for you.

@HiDAl
Copy link
Author

HiDAl commented Feb 24, 2023

@elasticsearchmachine run elasticsearch-ci/bwc

@HiDAl
Copy link
Author

HiDAl commented Feb 24, 2023

BWC tests are not passing due to this:

 Caused by: org.elasticsearch.transport.RemoteTransportException: [v8.6.3-0][127.0.0.1:33721][internal:cluster/coordination/join/validate]
16:00:18 »  Caused by: java.io.EOFException
16:00:18 »  	at org.elasticsearch.common.io.stream.InputStreamStreamInput.readByte(InputStreamStreamInput.java:47)
16:00:18 »  	at org.elasticsearch.common.io.stream.StreamInput.readInt(StreamInput.java:187)
16:00:18 »  	at org.elasticsearch.common.io.stream.FilterStreamInput.readInt(FilterStreamInput.java:50)
16:00:18 »  	at org.elasticsearch.health.metadata.HealthMetadata$ShardLimits.readFrom(HealthMetadata.java:128)
16:00:18 »  	at org.elasticsearch.health.metadata.HealthMetadata.<init>(HealthMetadata.java:51)
16:00:18 »  	at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:56)
16:00:18 »  	at org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:32)
16:00:18 »  	at org.elasticsearch.cluster.ClusterState.readFrom(ClusterState.java:841)
16:00:18 »  	at org.elasticsearch.cluster.coordination.ValidateJoinRequest.readCompressed(ValidateJoinRequest.java:59)
16:00:18 »  	at org.elasticsearch.cluster.coordination.ValidateJoinRequest.lambda$new$0(ValidateJoinRequest.java:36)
16:00:18 »  	at org.elasticsearch.cluster.coordination.ValidateJoinRequest.getOrReadState(ValidateJoinRequest.java:76)
16:00:18 »  	at org.elasticsearch.cluster.coordination.JoinValidationService.lambda$new$2(JoinValidationService.java:121)
16:00:18 »  	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:71)
16:00:18 »  	at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:283)
16:00:18 »  	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:958)
16:00:18 »  	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
16:00:18 »  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
16:00:18 »  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
16:00:18 »  	at java.lang.Thread.run(Thread.java:833)

converting to a draft in order of fix the issue first

@HiDAl HiDAl marked this pull request as draft February 24, 2023 16:36
@HiDAl HiDAl force-pushed the new-shard-limit-metadata branch from 4c1e61e to a07e5be Compare February 24, 2023 18:06
@HiDAl
Copy link
Author

HiDAl commented Feb 27, 2023

@elasticsearchmachine run elasticsearch-ci/bwc

@HiDAl HiDAl marked this pull request as ready for review February 28, 2023 08:12
Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

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

Thanks Pablo, this generally looks great.

I left a few suggestions

Copy link
Contributor

@gmarouli gmarouli left a comment

Choose a reason for hiding this comment

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

Thank for working on this, it's nice to see the HealthMetadata being extended :). I left some minor comments and I second Andrei's comments :).

@HiDAl HiDAl force-pushed the new-shard-limit-metadata branch from 9468d2f to 68fb6e2 Compare March 1, 2023 10:38
@HiDAl HiDAl requested review from andreidan and gmarouli March 1, 2023 10:41
@andreidan
Copy link
Contributor

elasticsearch-ci/bwc failure seems transient. Restarting

@andreidan
Copy link
Contributor

@elasticmachine run elasticsearch-ci/bwc

Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for iterating on this Pablo

@HiDAl
Copy link
Author

HiDAl commented Mar 2, 2023

@elasticmachine update branch

fix typo on method/variable names
Pablo Alcantar Morales added 2 commits March 2, 2023 12:52
ShardLimits validation shouldn't run as part of the construction of the
object, otherwise it will block the serialization path.
when serializing the value to the wire, we ensure that it's writable/readable using Optional methods.
add proper tests to check the null case
@HiDAl
Copy link
Author

HiDAl commented Mar 2, 2023

executed the serialization test 1000 times, no errors:

➜  elasticsearch git:(new-shard-limit-metadata) ✗ ./gradlew ':server:test' --tests "org.elasticsearch.health.metadata.HealthMetadataSerializationTests" -Dtests.iters=1000
=======================================
...
=======================================

> Task :server:test
[...]
BUILD SUCCESSFUL in 18s
61 actionable tasks: 2 executed, 59 up-to-date

Publishing build scan...
https://gradle-enterprise.elastic.co/s/endahupjxcp4y

@HiDAl
Copy link
Author

HiDAl commented Mar 2, 2023

@elasticmachine run elasticsearch-ci/part-2

@HiDAl HiDAl merged commit d10a976 into elastic:main Mar 2, 2023
@HiDAl HiDAl deleted the new-shard-limit-metadata branch March 2, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants