Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -233,16 +233,6 @@ public void testWriteLoadDeciderCanRemain() {
testHarness.routingAllocation
).type()
);
assertEquals(
"A shard without write load should remain on a node with queuing above the threshold",
Decision.Type.YES,
writeLoadDecider.canRemain(
testHarness.clusterState.metadata().getProject().index(indexName),
testHarness.shardRoutingNoWriteLoad,
testHarness.aboveQueuingThresholdRoutingNode,
testHarness.routingAllocation
).type()
);
Comment on lines 236 to 245
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a test to show a shard without write load can still trigger NOT_PREFERRED?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 6fc953f

}

private void assertDecisionMatches(String description, Decision decision, Decision.Type type, String explanationPattern) {
Expand Down