debug log of receiving a cluster state from another master could be erroneously logged

Added trace logging to MinimumMasterNodesTests.multipleNodesShutdownNonMasterNodes
This commit is contained in:
Boaz Leskes 2014-04-30 20:21:00 +02:00
parent 9493824a0e
commit 42a112f50b
2 changed files with 4 additions and 2 deletions

View File

@ -551,8 +551,8 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
newStateProcessed.onNewClusterStateFailed(new ElasticsearchIllegalStateException("received state from a node that is not part of the cluster"));
return;
}
logger.debug("received cluster state from [{}] which is also master but with cluster name [{}]", newClusterState.nodes().masterNode(), incomingClusterName);
if (master) {
logger.debug("received cluster state from [{}] which is also master but with cluster name [{}]", newClusterState.nodes().masterNode(), incomingClusterName);
final ClusterState newState = newClusterState;
clusterService.submitStateUpdateTask("zen-disco-master_receive_cluster_state_from_another_master [" + newState.nodes().masterNode() + "]", Priority.URGENT, new ProcessedClusterStateUpdateTask() {
@Override

View File

@ -30,13 +30,14 @@ import org.elasticsearch.discovery.zen.elect.ElectMasterService;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.junit.Test;
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.client.Requests.clusterHealthRequest;
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.*;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope;
import static org.hamcrest.Matchers.equalTo;
@ClusterScope(scope = Scope.TEST, numDataNodes =0)
@ -160,6 +161,7 @@ public class MinimumMasterNodesTests extends ElasticsearchIntegrationTest {
}
@Test
@TestLogging("cluster.service:TRACE,discovery:TRACE")
public void multipleNodesShutdownNonMasterNodes() throws Exception {
Settings settings = settingsBuilder()
.put("discovery.type", "zen")