log when search failure happen when scanning
This commit is contained in:
parent
f00664621f
commit
49f79f54d2
|
@ -44,12 +44,11 @@ import org.elasticsearch.node.internal.InternalNode;
|
|||
import org.elasticsearch.search.SearchHit;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static org.elasticsearch.common.settings.ImmutableSettings.*;
|
||||
import static org.elasticsearch.index.query.xcontent.QueryBuilders.*;
|
||||
import static org.hamcrest.MatcherAssert.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
|
@ -189,6 +188,8 @@ public class RollingRestartStressTest {
|
|||
|
||||
nodes[nodeIndex] = NodeBuilder.nodeBuilder().settings(settings).node();
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
try {
|
||||
ClusterHealthResponse clusterHealth = client.client().admin().cluster().prepareHealth()
|
||||
.setWaitForGreenStatus()
|
||||
|
@ -258,7 +259,9 @@ public class RollingRestartStressTest {
|
|||
|
||||
while (true) {
|
||||
searchResponse = client.client().prepareSearchScroll(searchResponse.scrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet();
|
||||
assertThat(searchResponse.failedShards(), equalTo(0));
|
||||
if (searchResponse.failedShards() > 0) {
|
||||
logger.warn("Search Failures " + Arrays.toString(searchResponse.shardFailures()));
|
||||
}
|
||||
for (SearchHit hit : searchResponse.hits()) {
|
||||
long version = -1;
|
||||
for (int i = 0; i < (numberOfReplicas + 1); i++) {
|
||||
|
@ -351,7 +354,7 @@ public class RollingRestartStressTest {
|
|||
.cleanNodeData(false)
|
||||
.indexers(5)
|
||||
.indexerThrottle(TimeValue.timeValueMillis(50))
|
||||
.period(TimeValue.timeValueMinutes(1));
|
||||
.period(TimeValue.timeValueMinutes(3));
|
||||
|
||||
test.run();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue