First increment shard stats before notifing and potentially sending response
When we skip a shard we should first increment the skip and successful shard
counters before we notify the super class about a skipped shard which could
send back the result before we increment the stats.
@@ -316,8 +316,8 @@ abstract class AbstractSearchAsyncAction<Result extends SearchPhaseResult> exten
@Override
protected void skipShard(SearchShardIterator iterator) {
- super.skipShard(iterator);
successfulOps.incrementAndGet();
skippedOps.incrementAndGet();
+ super.skipShard(iterator);
}
}
