Search: A failed search request might get overrun when trying another shard, closes #1403.
This commit is contained in:
parent
673655cc7b
commit
184a38439f
|
@ -119,10 +119,9 @@ public class SearchRequest implements ActionRequest {
|
|||
return validationException;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal.
|
||||
*/
|
||||
public void beforeLocalFork() {
|
||||
public void beforeStart() {
|
||||
// we always copy over if needed, the reason is that a request might fail while being search remotely
|
||||
// and then we need to keep the buffer around
|
||||
if (source != null && sourceUnsafe) {
|
||||
source = Arrays.copyOfRange(source, sourceOffset, sourceOffset + sourceLength);
|
||||
sourceOffset = 0;
|
||||
|
@ -135,6 +134,12 @@ public class SearchRequest implements ActionRequest {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal.
|
||||
*/
|
||||
public void beforeLocalFork() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Should the listener be called on a separate thread if needed.
|
||||
*/
|
||||
|
|
|
@ -130,6 +130,7 @@ public abstract class TransportSearchTypeAction extends BaseAction<SearchRequest
|
|||
}
|
||||
|
||||
public void start() {
|
||||
request.beforeStart();
|
||||
// count the local operations, and perform the non local ones
|
||||
int localOperations = 0;
|
||||
for (final ShardIterator shardIt : shardsIts) {
|
||||
|
|
Loading…
Reference in New Issue