Skip to content

Commit

Permalink
[Stats] update action returns before updating stats for NONE operat…
Browse files Browse the repository at this point in the history
…ions

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
  • Loading branch information
bleskes committed Sep 8, 2014
1 parent 72c4cb5 commit 9054ce5
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -270,14 +270,14 @@ protected void doRun() {
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());
if (shard != null) {
shard.indexingService().noopUpdate(request.request().type());
}
}
listener.onResponse(update);
break;
default:
throw new ElasticsearchIllegalStateException("Illegal operation " + result.operation());
Expand Down

0 comments on commit 9054ce5

Please sign in to comment.