Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ public Decision canRemain(IndexMetadata indexMetadata, ShardRouting shardRouting
return Decision.single(Decision.Type.YES, NAME, "canRemain() is not enabled");
}

// Check whether the shard being relocated has any write load estimate. If it does not, then this decider has no opinion.
var allShardWriteLoads = allocation.clusterInfo().getShardWriteLoads();
var shardWriteLoad = allShardWriteLoads.get(shardRouting.shardId());
if (shardWriteLoad == null || shardWriteLoad == 0) {
return Decision.single(Decision.Type.YES, NAME, "Shard has no estimated write load. Decider takes no action.");
}

var allNodeUsageStats = allocation.clusterInfo().getNodeUsageStatsForThreadPools();
var nodeUsageStatsForThreadPools = allNodeUsageStats.get(node.nodeId());
if (nodeUsageStatsForThreadPools == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ public void testWriteLoadDeciderCanRemain() {
).type()
);
assertEquals(
"A shard without write load should remain on a node with queuing above the threshold",
Decision.Type.YES,
"A shard with no write load can still return NOT_PREFERRED",
Decision.Type.NOT_PREFERRED,
writeLoadDecider.canRemain(
testHarness.clusterState.metadata().getProject().index(indexName),
testHarness.shardRoutingNoWriteLoad,
Expand Down