Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logging #88247

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -45,7 +45,6 @@
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
import org.elasticsearch.test.InternalTestCluster;
import org.elasticsearch.test.MockLogAppender;

import java.nio.file.Path;
Expand Down Expand Up @@ -219,7 +218,7 @@ public void testDelayWithALargeAmountOfShards() throws Exception {
.put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.getKey(), 1)
.build();
logger.info("--> starting 4 nodes");
String node_1 = internalCluster().startNode(commonSettings);
String node1 = internalCluster().startNode(commonSettings);
internalCluster().startNode(commonSettings);
internalCluster().startNode(commonSettings);
internalCluster().startNode(commonSettings);
Expand Down Expand Up @@ -247,7 +246,7 @@ public void testDelayWithALargeAmountOfShards() throws Exception {
ensureGreen(TimeValue.timeValueMinutes(1));

logger.info("--> stopping node1");
internalCluster().stopRandomNode(InternalTestCluster.nameFilter(node_1));
internalCluster().stopNode(node1);

// This might run slowly on older hardware
ensureGreen(TimeValue.timeValueMinutes(2));
Expand Down
Expand Up @@ -210,9 +210,6 @@ public DesiredBalance compute(
// TODO what if we never converge?
// TODO maybe expose interim desired balances computed here

if (i % 100 == 0) {
logger.trace("desired balance computation is still not completed after {} iterations", i);
}
if (hasChanges == false) {
logger.trace("desired balance computation converged after {} iterations", i);
break;
Expand All @@ -223,6 +220,9 @@ public DesiredBalance compute(
logger.trace("newer cluster state received, publishing incomplete desired balance and restarting computation");
break;
}
if (i > 0 && i % 100 == 0) {
logger.warn("desired balance computation is still not converged after {} iterations", i);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do not log if:

  • iteration is 0
  • if already converged or outdated

}

final var assignments = new HashMap<ShardId, ShardAssignment>();
Expand Down