Skip to content

Commit

Permalink
Additional logging for testRestoreSnapshotAllocationDoesNotExceedWate…
Browse files Browse the repository at this point in the history
…rmarkWithMultipleShards (elastic#106255)
  • Loading branch information
idegtiarenko authored Mar 13, 2024
1 parent 7cd0902 commit ab8f435
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ public void testRestoreSnapshotAllocationDoesNotExceedWatermark() throws Excepti
@TestIssueLogging(
value = "org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceComputer:TRACE,"
+ "org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceReconciler:DEBUG,"
+ "org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceShardsAllocator:TRACE",
+ "org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceShardsAllocator:TRACE,"
+ "org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator:TRACE,"
+ "org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders:TRACE,"
+ "org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider:TRACE",
issueUrl = "https://github.com/elastic/elasticsearch/issues/105331"
)
public void testRestoreSnapshotAllocationDoesNotExceedWatermarkWithMultipleShards() throws Exception {
Expand Down Expand Up @@ -291,10 +294,6 @@ public Set<ShardId> getShardIdsWithSizeSmallerOrEqual(long size) {
public Set<ShardId> getSmallestShardIds() {
return getShardIdsWithSizeSmallerOrEqual(getSmallestShardSize());
}

public Set<ShardId> getAllShardIds() {
return sizes.stream().map(ShardSize::shardId).collect(toSet());
}
}

private record ShardSize(ShardId shardId, long size) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,10 +1300,6 @@ public ShardAllocationDecision decideShardAllocation(ShardRouting shard, Routing
}, DesiredBalanceComputer.class, expectation);
}

private static Map.Entry<String, Long> indexSize(ClusterState clusterState, String name, long size, boolean primary) {
return Map.entry(shardIdentifierFromRouting(findShardId(clusterState, name), primary), size);
}

private static ShardId findShardId(ClusterState clusterState, String name) {
return clusterState.getRoutingTable().index(name).shard(0).shardId();
}
Expand Down

0 comments on commit ab8f435

Please sign in to comment.