From 0d0c103451948ac210e229597da2f0fdb50ef618 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 21 Jul 2017 08:46:10 +0200 Subject: [PATCH] First increment shard stats before notifing and potentially sending response (#25818) 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. --- .../elasticsearch/action/search/AbstractSearchAsyncAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/action/search/AbstractSearchAsyncAction.java b/core/src/main/java/org/elasticsearch/action/search/AbstractSearchAsyncAction.java index bd721adaf12..89be2ecabeb 100644 --- a/core/src/main/java/org/elasticsearch/action/search/AbstractSearchAsyncAction.java +++ b/core/src/main/java/org/elasticsearch/action/search/AbstractSearchAsyncAction.java @@ -316,8 +316,8 @@ abstract class AbstractSearchAsyncAction exten @Override protected void skipShard(SearchShardIterator iterator) { - super.skipShard(iterator); successfulOps.incrementAndGet(); skippedOps.incrementAndGet(); + super.skipShard(iterator); } }