[Stats] update action returns before updating stats for `NONE` operations

We keep around a noop stats indicating how many update operations ended up not updating the document (typically because it didn't change). However, the TransportUpdateAction update that counter only after returning the result. This can throw off stats check which are done immediately after, potentially causing test failures.

Closes #7639
This commit is contained in:
Boaz Leskes 2014-09-08 12:11:42 +02:00
parent 72c4cb51cc
commit 9054ce5569
1 changed files with 1 additions and 1 deletions

View File

@ -270,7 +270,6 @@ public class TransportUpdateAction extends TransportInstanceSingleOperationActio
break;
case NONE:
UpdateResponse update = result.action();
listener.onResponse(update);
IndexService indexServiceOrNull = indicesService.indexService(request.concreteIndex());
if (indexServiceOrNull != null) {
IndexShard shard = indexService.shard(request.request().shardId());
@ -278,6 +277,7 @@ public class TransportUpdateAction extends TransportInstanceSingleOperationActio
shard.indexingService().noopUpdate(request.request().type());
}
}
listener.onResponse(update);
break;
default:
throw new ElasticsearchIllegalStateException("Illegal operation " + result.operation());