Don't use mock wrapper on relocate stress test for now since it could be the reason for intermediate/occational failures

This commit is contained in:
Simon Willnauer 2013-11-23 09:21:35 +01:00
parent fdc4f72e8a
commit 34d567a133
2 changed files with 7 additions and 2 deletions

View File

@ -418,6 +418,7 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
public FetchSearchResult executeFetchPhase(FetchSearchRequest request) throws ElasticSearchException { public FetchSearchResult executeFetchPhase(FetchSearchRequest request) throws ElasticSearchException {
SearchContext context = findContext(request.id()); SearchContext context = findContext(request.id());
contextProcessing(context); contextProcessing(context);
boolean contextFreed = false;
try { try {
context.docIdsToLoad(request.docIds(), 0, request.docIdsSize()); context.docIdsToLoad(request.docIds(), 0, request.docIdsSize());
context.indexShard().searchService().onPreFetchPhase(context); context.indexShard().searchService().onPreFetchPhase(context);
@ -425,6 +426,7 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
fetchPhase.execute(context); fetchPhase.execute(context);
if (context.scroll() == null) { if (context.scroll() == null) {
freeContext(request.id()); freeContext(request.id());
contextFreed = true;
} else { } else {
contextProcessedSuccessfully(context); contextProcessedSuccessfully(context);
} }
@ -433,7 +435,9 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
} catch (Throwable e) { } catch (Throwable e) {
context.indexShard().searchService().onFailedFetchPhase(context); context.indexShard().searchService().onFailedFetchPhase(context);
logger.trace("Fetch phase failed", e); logger.trace("Fetch phase failed", e);
freeContext(context); if (!contextFreed) {
freeContext(context);
}
throw ExceptionsHelper.convertToRuntime(e); throw ExceptionsHelper.convertToRuntime(e);
} finally { } finally {
cleanContext(context); cleanContext(context);

View File

@ -57,7 +57,8 @@ public class SearchWhileRelocatingTests extends ElasticsearchIntegrationTest {
private void testSearchAndRelocateConcurrently(int numberOfReplicas) throws Exception { private void testSearchAndRelocateConcurrently(int numberOfReplicas) throws Exception {
final int numShards = between(10, 20); final int numShards = between(10, 20);
client().admin().indices().prepareCreate("test") client().admin().indices().prepareCreate("test")
.setSettings(settingsBuilder().put("index.number_of_shards", numShards).put("index.number_of_replicas", numberOfReplicas)) .setSettings(settingsBuilder().put("index.number_of_shards", numShards).put("index.number_of_replicas", numberOfReplicas)
.put("index.store.type", "niofs"))
.addMapping("type1", "loc", "type=geo_point", "test", "type=string").execute().actionGet(); .addMapping("type1", "loc", "type=geo_point", "test", "type=string").execute().actionGet();
ensureGreen(); ensureGreen();
List<IndexRequestBuilder> indexBuilders = new ArrayList<IndexRequestBuilder>(); List<IndexRequestBuilder> indexBuilders = new ArrayList<IndexRequestBuilder>();