add doc
This commit is contained in:
parent
62526444fd
commit
e11589f3c7
|
@ -149,6 +149,8 @@ public class LocalGatewayNodeAllocation extends NodeAllocation {
|
||||||
|
|
||||||
for (IndexRoutingTable indexRoutingTable : routingNodes.routingTable()) {
|
for (IndexRoutingTable indexRoutingTable : routingNodes.routingTable()) {
|
||||||
// only do the allocation if there is a local "INDEX NOT RECOVERED" block
|
// only do the allocation if there is a local "INDEX NOT RECOVERED" block
|
||||||
|
// we check this here since it helps distinguish between index creation though an API, where the below logic
|
||||||
|
// should not apply, and when recovering from the gateway, where we should apply this logic
|
||||||
if (!routingNodes.blocks().hasIndexBlock(indexRoutingTable.index(), LocalGateway.INDEX_NOT_RECOVERED_BLOCK)) {
|
if (!routingNodes.blocks().hasIndexBlock(indexRoutingTable.index(), LocalGateway.INDEX_NOT_RECOVERED_BLOCK)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,15 +53,18 @@ public class QuorumLocalGatewayTests extends AbstractNodesTests {
|
||||||
|
|
||||||
@Test public void testQuorumRecovery() throws Exception {
|
@Test public void testQuorumRecovery() throws Exception {
|
||||||
// clean three nodes
|
// clean three nodes
|
||||||
|
logger.info("--> cleaning nodes");
|
||||||
buildNode("node1", settingsBuilder().put("gateway.type", "local").build());
|
buildNode("node1", settingsBuilder().put("gateway.type", "local").build());
|
||||||
buildNode("node2", settingsBuilder().put("gateway.type", "local").build());
|
buildNode("node2", settingsBuilder().put("gateway.type", "local").build());
|
||||||
buildNode("node3", settingsBuilder().put("gateway.type", "local").build());
|
buildNode("node3", settingsBuilder().put("gateway.type", "local").build());
|
||||||
cleanAndCloseNodes();
|
cleanAndCloseNodes();
|
||||||
|
|
||||||
|
logger.info("--> starting 3 nodes");
|
||||||
Node node1 = startNode("node1", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 2).put("index.number_of_replicas", 2).build());
|
Node node1 = startNode("node1", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 2).put("index.number_of_replicas", 2).build());
|
||||||
Node node2 = startNode("node2", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 2).put("index.number_of_replicas", 2).build());
|
Node node2 = startNode("node2", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 2).put("index.number_of_replicas", 2).build());
|
||||||
Node node3 = startNode("node3", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 2).put("index.number_of_replicas", 2).build());
|
Node node3 = startNode("node3", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 2).put("index.number_of_replicas", 2).build());
|
||||||
|
|
||||||
|
logger.info("--> indexing...");
|
||||||
node1.client().prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject().field("field", "value1").endObject()).execute().actionGet();
|
node1.client().prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject().field("field", "value1").endObject()).execute().actionGet();
|
||||||
node1.client().admin().indices().prepareFlush().execute().actionGet();
|
node1.client().admin().indices().prepareFlush().execute().actionGet();
|
||||||
node1.client().prepareIndex("test", "type1", "2").setSource(jsonBuilder().startObject().field("field", "value2").endObject()).execute().actionGet();
|
node1.client().prepareIndex("test", "type1", "2").setSource(jsonBuilder().startObject().field("field", "value2").endObject()).execute().actionGet();
|
||||||
|
|
Loading…
Reference in New Issue