Skip to content

Commit

Permalink
Update logging (#88247)
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Jul 5, 2022
1 parent f2847f9 commit f2796ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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 @@ -220,7 +219,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 @@ -248,7 +247,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);
}
}

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

0 comments on commit f2796ed

Please sign in to comment.