From d167a0139a890af72d2442e588575f7c71579652 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 27 Feb 2014 13:26:54 +0100 Subject: [PATCH] estimator#afterLoad should be invoked once only per reader. It was being invoked once per reader and parent type combination resulting in more memory being reported to the circuit breaker than actually being used in field data. --- .../index/fielddata/plain/ParentChildIndexFieldData.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java index ecc9c23c310..435abb23a5f 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java @@ -136,9 +136,9 @@ public class ParentChildIndexFieldData extends AbstractIndexFieldData cursor : typeBuilders) { cursor.value.builder.close(); - if (success) { - estimator.afterLoad(null, data.getMemorySizeInBytes()); - } + } + if (success) { + estimator.afterLoad(null, data.getMemorySizeInBytes()); } } }