Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

If a shard has no desired assignment then we cannot send the desired
balance over the wire or render it as JSON because the
ShardAssignmentView is null. This commit replaces the spurious
null with an empty object, and cleans up the tests a little to remove
some unnecessary mocking.

If a shard has no desired assignment then we cannot send the desired balance over the wire or render it as JSON because the `ShardAssignmentView` is `null`. This commit replaces the spurious `null` with an empty object, and cleans up the tests a little to remove some unnecessary mocking.
@DaveCTurner DaveCTurner added >bug :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) v8.10.0 v8.9.1 labels Jul 19, 2023
@DaveCTurner DaveCTurner requested a review from idegtiarenko July 19, 2023 08:15
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jul 19, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

assertEquals(shardAssignment.get().unassigned(), desiredShard.desired().unassigned());
assertEquals(shardAssignment.get().ignored(), desiredShard.desired().ignored());
final var shardAssignment = shardAssignments.get(indexShardRoutingTable.shardId());
if (shardAssignment == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this test generating null assignments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it only assigns some random subset of the shards.

@DaveCTurner DaveCTurner added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport-and-merge labels Jul 19, 2023
slobodanadamovic pushed a commit to slobodanadamovic/elasticsearch that referenced this pull request Jul 19, 2023
If a shard has no desired assignment then we cannot send the desired balance over the wire or render it as JSON because the `ShardAssignmentView` is `null`. This commit replaces the spurious `null` with an empty object, and cleans up the tests a little to remove some unnecessary mocking.
@DaveCTurner
Copy link
Contributor Author

I'm confused, this is apparently merged at 1ef7d3f but this PR is still open.

@DaveCTurner DaveCTurner merged commit 00b5050 into elastic:main Jul 19, 2023
@DaveCTurner DaveCTurner deleted the 2023/07/19/desired-balance-npe branch July 19, 2023 09:43
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 97775

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 19, 2023
If a shard has no desired assignment then we cannot send the desired balance over the wire or render it as JSON because the `ShardAssignmentView` is `null`. This commit replaces the spurious `null` with an empty object, and cleans up the tests a little to remove some unnecessary mocking.
@DaveCTurner DaveCTurner removed auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport-and-merge labels Jul 19, 2023
elasticsearchmachine pushed a commit that referenced this pull request Jul 19, 2023
If a shard has no desired assignment then we cannot send the desired balance over the wire or render it as JSON because the `ShardAssignmentView` is `null`. This commit replaces the spurious `null` with an empty object, and cleans up the tests a little to remove some unnecessary mocking.
@rjernst rjernst added v8.9.0 and removed v8.9.1 labels Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport pending >bug :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.9.0 v8.10.0

4 participants