|
@@ -26,7 +26,10 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
|
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
|
|
import org.elasticsearch.cluster.routing.RoutingTable;
|
|
|
import org.elasticsearch.cluster.routing.ShardRoutingState;
|
|
|
-import org.elasticsearch.cluster.routing.allocation.command.AllocateAllocationCommand;
|
|
|
+import org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand;
|
|
|
+import org.elasticsearch.cluster.routing.allocation.command.AllocateEmptyPrimaryAllocationCommand;
|
|
|
+import org.elasticsearch.cluster.routing.allocation.command.AllocateReplicaAllocationCommand;
|
|
|
+import org.elasticsearch.cluster.routing.allocation.command.AllocateStalePrimaryAllocationCommand;
|
|
|
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands;
|
|
|
import org.elasticsearch.cluster.routing.allocation.command.CancelAllocationCommand;
|
|
|
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
|
|
@@ -38,7 +41,9 @@ import org.elasticsearch.common.logging.Loggers;
|
|
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
|
|
import org.elasticsearch.common.xcontent.XContentParser;
|
|
|
import org.elasticsearch.common.xcontent.XContentType;
|
|
|
+import org.elasticsearch.index.IndexNotFoundException;
|
|
|
import org.elasticsearch.index.shard.ShardId;
|
|
|
+import org.elasticsearch.index.shard.ShardNotFoundException;
|
|
|
import org.elasticsearch.test.ESAllocationTestCase;
|
|
|
|
|
|
import static java.util.Collections.singletonMap;
|
|
@@ -46,6 +51,7 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
|
|
import static org.elasticsearch.cluster.routing.ShardRoutingState.RELOCATING;
|
|
|
import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED;
|
|
|
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
|
|
+import static org.hamcrest.Matchers.containsString;
|
|
|
import static org.hamcrest.Matchers.equalTo;
|
|
|
|
|
|
/**
|
|
@@ -96,6 +102,14 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
assertThat(clusterState.getRoutingNodes().node(toNodeId).get(0).state(), equalTo(ShardRoutingState.STARTED));
|
|
|
}
|
|
|
|
|
|
+ private AbstractAllocateAllocationCommand randomAllocateCommand(ShardId shardId, String node) {
|
|
|
+ return randomFrom(
|
|
|
+ new AllocateReplicaAllocationCommand(shardId, node),
|
|
|
+ new AllocateEmptyPrimaryAllocationCommand(shardId, node, true),
|
|
|
+ new AllocateStalePrimaryAllocationCommand(shardId, node, true)
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
public void testAllocateCommand() {
|
|
|
AllocationService allocation = createAllocationService(settingsBuilder()
|
|
|
.put(EnableAllocationDecider.CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING.getKey(), "none")
|
|
@@ -106,10 +120,13 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
MetaData metaData = MetaData.builder()
|
|
|
.put(IndexMetaData.builder("test").settings(settings(Version.CURRENT)).numberOfShards(1).numberOfReplicas(1))
|
|
|
.build();
|
|
|
+ // shard routing is added as "from recovery" instead of "new index creation" so that we can test below that allocating an empty
|
|
|
+ // primary with accept_data_loss flag set to false fails
|
|
|
RoutingTable routingTable = RoutingTable.builder()
|
|
|
- .addAsNew(metaData.index("test"))
|
|
|
+ .addAsRecovery(metaData.index("test"))
|
|
|
.build();
|
|
|
ClusterState clusterState = ClusterState.builder(org.elasticsearch.cluster.ClusterName.DEFAULT).metaData(metaData).routingTable(routingTable).build();
|
|
|
+ ShardId shardId = new ShardId("test", 0);
|
|
|
|
|
|
logger.info("--> adding 3 nodes on same rack and do rerouting");
|
|
|
clusterState = ClusterState.builder(clusterState).nodes(DiscoveryNodes.builder()
|
|
@@ -122,22 +139,56 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().shardsWithState(INITIALIZING).size(), equalTo(0));
|
|
|
|
|
|
- logger.info("--> allocating with primary flag set to false, should fail");
|
|
|
+ logger.info("--> allocating to non-existent node, should fail");
|
|
|
try {
|
|
|
- allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node1", false)));
|
|
|
- fail();
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(randomAllocateCommand(shardId, "node42")));
|
|
|
+ fail("expected IllegalArgumentException when allocating to non-existing node");
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
+ assertThat(e.getMessage(), containsString("failed to resolve [node42], no matching nodes"));
|
|
|
}
|
|
|
|
|
|
logger.info("--> allocating to non-data node, should fail");
|
|
|
try {
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node4", true)));
|
|
|
- fail();
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(randomAllocateCommand(shardId, "node4")));
|
|
|
+ fail("expected IllegalArgumentException when allocating to non-data node");
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
+ assertThat(e.getMessage(), containsString("allocation can only be done on data nodes"));
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info("--> allocating non-existing shard, should fail");
|
|
|
+ try {
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(randomAllocateCommand(new ShardId("test", 1), "node2")));
|
|
|
+ fail("expected ShardNotFoundException when allocating non-existing shard");
|
|
|
+ } catch (ShardNotFoundException e) {
|
|
|
+ assertThat(e.getMessage(), containsString("no such shard"));
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info("--> allocating non-existing index, should fail");
|
|
|
+ try {
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(randomAllocateCommand(new ShardId("test2", 0), "node2")));
|
|
|
+ fail("expected ShardNotFoundException when allocating non-existing index");
|
|
|
+ } catch (IndexNotFoundException e) {
|
|
|
+ assertThat(e.getMessage(), containsString("no such index"));
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info("--> allocating empty primary with acceptDataLoss flag set to false");
|
|
|
+ try {
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(new AllocateEmptyPrimaryAllocationCommand(new ShardId("test", 0), "node1", false)));
|
|
|
+ fail("expected IllegalArgumentException when allocating empty primary with acceptDataLoss flag set to false");
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
+ assertThat(e.getMessage(), containsString("allocating an empty primary for " + shardId + " can result in data loss. Please confirm by setting the accept_data_loss parameter to true"));
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info("--> allocating stale primary with acceptDataLoss flag set to false");
|
|
|
+ try {
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(new AllocateStalePrimaryAllocationCommand(shardId, "node1", false)));
|
|
|
+ fail("expected IllegalArgumentException when allocating stale primary with acceptDataLoss flag set to false");
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
+ assertThat(e.getMessage(), containsString("allocating an empty primary for " + shardId + " can result in data loss. Please confirm by setting the accept_data_loss parameter to true"));
|
|
|
}
|
|
|
|
|
|
- logger.info("--> allocating with primary flag set to true");
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node1", true)));
|
|
|
+ logger.info("--> allocating empty primary with acceptDataLoss flag set to true");
|
|
|
+ rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateEmptyPrimaryAllocationCommand(new ShardId("test", 0), "node1", true)));
|
|
|
assertThat(rerouteResult.changed(), equalTo(true));
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().node("node1").size(), equalTo(1));
|
|
@@ -153,13 +204,13 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
|
|
|
logger.info("--> allocate the replica shard on the primary shard node, should fail");
|
|
|
try {
|
|
|
- allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node1", false)));
|
|
|
- fail();
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(new AllocateReplicaAllocationCommand(new ShardId("test", 0), "node1")));
|
|
|
+ fail("expected IllegalArgumentException when allocating replica shard on the primary shard node");
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
}
|
|
|
|
|
|
logger.info("--> allocate the replica shard on on the second node");
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node2", false)));
|
|
|
+ rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateReplicaAllocationCommand(new ShardId("test", 0), "node2")));
|
|
|
assertThat(rerouteResult.changed(), equalTo(true));
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().node("node1").size(), equalTo(1));
|
|
@@ -178,8 +229,8 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
|
|
|
logger.info("--> verify that we fail when there are no unassigned shards");
|
|
|
try {
|
|
|
- allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node3", false)));
|
|
|
- fail();
|
|
|
+ allocation.reroute(clusterState, new AllocationCommands(randomAllocateCommand(new ShardId("test", 0), "node3")));
|
|
|
+ fail("expected IllegalArgumentException when allocating shard while no unassigned shard available");
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
}
|
|
|
}
|
|
@@ -209,8 +260,8 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().shardsWithState(INITIALIZING).size(), equalTo(0));
|
|
|
|
|
|
- logger.info("--> allocating with primary flag set to true");
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node1", true)));
|
|
|
+ logger.info("--> allocating empty primary shard with accept_data_loss flag set to true");
|
|
|
+ rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateEmptyPrimaryAllocationCommand(new ShardId("test", 0), "node1", true)));
|
|
|
assertThat(rerouteResult.changed(), equalTo(true));
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().node("node1").size(), equalTo(1));
|
|
@@ -239,7 +290,7 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
}
|
|
|
|
|
|
logger.info("--> allocate the replica shard on on the second node");
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node2", false)));
|
|
|
+ rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateReplicaAllocationCommand(new ShardId("test", 0), "node2")));
|
|
|
assertThat(rerouteResult.changed(), equalTo(true));
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().node("node1").size(), equalTo(1));
|
|
@@ -257,7 +308,7 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
assertThat(clusterState.getRoutingNodes().node("node3").size(), equalTo(0));
|
|
|
|
|
|
logger.info("--> allocate the replica shard on on the second node");
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node2", false)));
|
|
|
+ rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateReplicaAllocationCommand(new ShardId("test", 0), "node2")));
|
|
|
assertThat(rerouteResult.changed(), equalTo(true));
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(clusterState.getRoutingNodes().node("node1").size(), equalTo(1));
|
|
@@ -290,7 +341,7 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
assertThat(clusterState.getRoutingNodes().node("node3").size(), equalTo(0));
|
|
|
|
|
|
logger.info("--> allocate the replica shard on on the second node");
|
|
|
- rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateAllocationCommand(new ShardId("test", 0), "node2", false)));
|
|
|
+ rerouteResult = allocation.reroute(clusterState, new AllocationCommands(new AllocateReplicaAllocationCommand(new ShardId("test", 0), "node2")));
|
|
|
clusterState = ClusterState.builder(clusterState).routingTable(rerouteResult.routingTable()).build();
|
|
|
assertThat(rerouteResult.changed(), equalTo(true));
|
|
|
assertThat(clusterState.getRoutingNodes().node("node1").size(), equalTo(1));
|
|
@@ -335,7 +386,9 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
|
|
|
public void testSerialization() throws Exception {
|
|
|
AllocationCommands commands = new AllocationCommands(
|
|
|
- new AllocateAllocationCommand(new ShardId("test", 1), "node1", true),
|
|
|
+ new AllocateEmptyPrimaryAllocationCommand(new ShardId("test", 1), "node1", true),
|
|
|
+ new AllocateStalePrimaryAllocationCommand(new ShardId("test", 2), "node1", true),
|
|
|
+ new AllocateReplicaAllocationCommand(new ShardId("test", 2), "node1"),
|
|
|
new MoveAllocationCommand(new ShardId("test", 3), "node2", "node3"),
|
|
|
new CancelAllocationCommand(new ShardId("test", 4), "node5", true)
|
|
|
);
|
|
@@ -343,24 +396,33 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
AllocationCommands.writeTo(commands, bytes);
|
|
|
AllocationCommands sCommands = AllocationCommands.readFrom(StreamInput.wrap(bytes.bytes()));
|
|
|
|
|
|
- assertThat(sCommands.commands().size(), equalTo(3));
|
|
|
- assertThat(((AllocateAllocationCommand) (sCommands.commands().get(0))).shardId(), equalTo(new ShardId("test", 1)));
|
|
|
- assertThat(((AllocateAllocationCommand) (sCommands.commands().get(0))).node(), equalTo("node1"));
|
|
|
- assertThat(((AllocateAllocationCommand) (sCommands.commands().get(0))).allowPrimary(), equalTo(true));
|
|
|
+ assertThat(sCommands.commands().size(), equalTo(5));
|
|
|
+ assertThat(((AllocateEmptyPrimaryAllocationCommand) (sCommands.commands().get(0))).shardId(), equalTo(new ShardId("test", 1)));
|
|
|
+ assertThat(((AllocateEmptyPrimaryAllocationCommand) (sCommands.commands().get(0))).node(), equalTo("node1"));
|
|
|
+ assertThat(((AllocateEmptyPrimaryAllocationCommand) (sCommands.commands().get(0))).acceptDataLoss(), equalTo(true));
|
|
|
+
|
|
|
+ assertThat(((AllocateStalePrimaryAllocationCommand) (sCommands.commands().get(1))).shardId(), equalTo(new ShardId("test", 2)));
|
|
|
+ assertThat(((AllocateStalePrimaryAllocationCommand) (sCommands.commands().get(1))).node(), equalTo("node1"));
|
|
|
+ assertThat(((AllocateStalePrimaryAllocationCommand) (sCommands.commands().get(1))).acceptDataLoss(), equalTo(true));
|
|
|
|
|
|
- assertThat(((MoveAllocationCommand) (sCommands.commands().get(1))).shardId(), equalTo(new ShardId("test", 3)));
|
|
|
- assertThat(((MoveAllocationCommand) (sCommands.commands().get(1))).fromNode(), equalTo("node2"));
|
|
|
- assertThat(((MoveAllocationCommand) (sCommands.commands().get(1))).toNode(), equalTo("node3"));
|
|
|
+ assertThat(((AllocateReplicaAllocationCommand) (sCommands.commands().get(2))).shardId(), equalTo(new ShardId("test", 2)));
|
|
|
+ assertThat(((AllocateReplicaAllocationCommand) (sCommands.commands().get(2))).node(), equalTo("node1"));
|
|
|
|
|
|
- assertThat(((CancelAllocationCommand) (sCommands.commands().get(2))).shardId(), equalTo(new ShardId("test", 4)));
|
|
|
- assertThat(((CancelAllocationCommand) (sCommands.commands().get(2))).node(), equalTo("node5"));
|
|
|
- assertThat(((CancelAllocationCommand) (sCommands.commands().get(2))).allowPrimary(), equalTo(true));
|
|
|
+ assertThat(((MoveAllocationCommand) (sCommands.commands().get(3))).shardId(), equalTo(new ShardId("test", 3)));
|
|
|
+ assertThat(((MoveAllocationCommand) (sCommands.commands().get(3))).fromNode(), equalTo("node2"));
|
|
|
+ assertThat(((MoveAllocationCommand) (sCommands.commands().get(3))).toNode(), equalTo("node3"));
|
|
|
+
|
|
|
+ assertThat(((CancelAllocationCommand) (sCommands.commands().get(4))).shardId(), equalTo(new ShardId("test", 4)));
|
|
|
+ assertThat(((CancelAllocationCommand) (sCommands.commands().get(4))).node(), equalTo("node5"));
|
|
|
+ assertThat(((CancelAllocationCommand) (sCommands.commands().get(4))).allowPrimary(), equalTo(true));
|
|
|
}
|
|
|
|
|
|
public void testXContent() throws Exception {
|
|
|
String commands = "{\n" +
|
|
|
" \"commands\" : [\n" +
|
|
|
- " {\"allocate\" : {\"index\" : \"test\", \"shard\" : 1, \"node\" : \"node1\", \"allow_primary\" : true}}\n" +
|
|
|
+ " {\"allocate_empty_primary\" : {\"index\" : \"test\", \"shard\" : 1, \"node\" : \"node1\", \"accept_data_loss\" : true}}\n" +
|
|
|
+ " ,{\"allocate_stale_primary\" : {\"index\" : \"test\", \"shard\" : 2, \"node\" : \"node1\", \"accept_data_loss\" : true}}\n" +
|
|
|
+ " ,{\"allocate_replica\" : {\"index\" : \"test\", \"shard\" : 2, \"node\" : \"node1\"}}\n" +
|
|
|
" ,{\"move\" : {\"index\" : \"test\", \"shard\" : 3, \"from_node\" : \"node2\", \"to_node\" : \"node3\"}} \n" +
|
|
|
" ,{\"cancel\" : {\"index\" : \"test\", \"shard\" : 4, \"node\" : \"node5\", \"allow_primary\" : true}} \n" +
|
|
|
" ]\n" +
|
|
@@ -371,17 +433,24 @@ public class AllocationCommandsTests extends ESAllocationTestCase {
|
|
|
parser.nextToken();
|
|
|
AllocationCommands sCommands = AllocationCommands.fromXContent(parser);
|
|
|
|
|
|
- assertThat(sCommands.commands().size(), equalTo(3));
|
|
|
- assertThat(((AllocateAllocationCommand) (sCommands.commands().get(0))).shardId(), equalTo(new ShardId("test", 1)));
|
|
|
- assertThat(((AllocateAllocationCommand) (sCommands.commands().get(0))).node(), equalTo("node1"));
|
|
|
- assertThat(((AllocateAllocationCommand) (sCommands.commands().get(0))).allowPrimary(), equalTo(true));
|
|
|
+ assertThat(sCommands.commands().size(), equalTo(5));
|
|
|
+ assertThat(((AllocateEmptyPrimaryAllocationCommand) (sCommands.commands().get(0))).shardId(), equalTo(new ShardId("test", 1)));
|
|
|
+ assertThat(((AllocateEmptyPrimaryAllocationCommand) (sCommands.commands().get(0))).node(), equalTo("node1"));
|
|
|
+ assertThat(((AllocateEmptyPrimaryAllocationCommand) (sCommands.commands().get(0))).acceptDataLoss(), equalTo(true));
|
|
|
+
|
|
|
+ assertThat(((AllocateStalePrimaryAllocationCommand) (sCommands.commands().get(1))).shardId(), equalTo(new ShardId("test", 2)));
|
|
|
+ assertThat(((AllocateStalePrimaryAllocationCommand) (sCommands.commands().get(1))).node(), equalTo("node1"));
|
|
|
+ assertThat(((AllocateStalePrimaryAllocationCommand) (sCommands.commands().get(1))).acceptDataLoss(), equalTo(true));
|
|
|
+
|
|
|
+ assertThat(((AllocateReplicaAllocationCommand) (sCommands.commands().get(2))).shardId(), equalTo(new ShardId("test", 2)));
|
|
|
+ assertThat(((AllocateReplicaAllocationCommand) (sCommands.commands().get(2))).node(), equalTo("node1"));
|
|
|
|
|
|
- assertThat(((MoveAllocationCommand) (sCommands.commands().get(1))).shardId(), equalTo(new ShardId("test", 3)));
|
|
|
- assertThat(((MoveAllocationCommand) (sCommands.commands().get(1))).fromNode(), equalTo("node2"));
|
|
|
- assertThat(((MoveAllocationCommand) (sCommands.commands().get(1))).toNode(), equalTo("node3"));
|
|
|
+ assertThat(((MoveAllocationCommand) (sCommands.commands().get(3))).shardId(), equalTo(new ShardId("test", 3)));
|
|
|
+ assertThat(((MoveAllocationCommand) (sCommands.commands().get(3))).fromNode(), equalTo("node2"));
|
|
|
+ assertThat(((MoveAllocationCommand) (sCommands.commands().get(3))).toNode(), equalTo("node3"));
|
|
|
|
|
|
- assertThat(((CancelAllocationCommand) (sCommands.commands().get(2))).shardId(), equalTo(new ShardId("test", 4)));
|
|
|
- assertThat(((CancelAllocationCommand) (sCommands.commands().get(2))).node(), equalTo("node5"));
|
|
|
- assertThat(((CancelAllocationCommand) (sCommands.commands().get(2))).allowPrimary(), equalTo(true));
|
|
|
+ assertThat(((CancelAllocationCommand) (sCommands.commands().get(4))).shardId(), equalTo(new ShardId("test", 4)));
|
|
|
+ assertThat(((CancelAllocationCommand) (sCommands.commands().get(4))).node(), equalTo("node5"));
|
|
|
+ assertThat(((CancelAllocationCommand) (sCommands.commands().get(4))).allowPrimary(), equalTo(true));
|
|
|
}
|
|
|
}
|