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 @@ -22,7 +22,6 @@
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
Expand Down Expand Up @@ -66,11 +65,6 @@ public void testQuorumRecovery() throws Exception {
}
logger.info("--> restart all nodes");
internalCluster().fullRestart(new RestartCallback() {
@Override
public Settings onNodeStopped(String nodeName) throws Exception {
return null;
}

@Override
public void doAfterNodes(int numNodes, final Client activeClient) throws Exception {
if (numNodes == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,7 @@ public void testRestoreIndexWithShardsMissingInLocalGateway() throws Exception {
.put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE)
.build();

internalCluster().startNode(nodeSettings);
internalCluster().startNode(nodeSettings);
internalCluster().startNodes(2, nodeSettings);
cluster().wipeIndices("_all");

logger.info("--> create repository");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -929,13 +929,15 @@ Settings closeForRestart(RestartCallback callback, int minMasterNodes) throws Ex
assert callback != null;
close();
Settings callbackSettings = callback.onNodeStopped(name);
assert callbackSettings != null;
Settings.Builder newSettings = Settings.builder();
if (callbackSettings != null) {
newSettings.put(callbackSettings);
}
newSettings.put(callbackSettings);
if (minMasterNodes >= 0) {
assert DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.exists(newSettings.build()) == false : "min master nodes is auto managed";
newSettings.put(DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey(), minMasterNodes).build();
newSettings.put(DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey(), minMasterNodes);
if (INITIAL_MASTER_NODES_SETTING.exists(callbackSettings) == false) {
newSettings.putList(INITIAL_MASTER_NODES_SETTING.getKey());
}
}
// delete data folders now, before we start other nodes that may claim it
clearDataIfNeeded(callback);
Expand Down Expand Up @@ -1691,12 +1693,7 @@ public synchronized void restartNode(String nodeName, RestartCallback callback)
}
}

public static final RestartCallback EMPTY_CALLBACK = new RestartCallback() {
@Override
public Settings onNodeStopped(String node) {
return null;
}
};
public static final RestartCallback EMPTY_CALLBACK = new RestartCallback();

/**
* Restarts all nodes in the cluster. It first stops all nodes and then restarts all the nodes again.
Expand Down