diff --git a/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java b/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java index de8943ddf1b..51f3ae43149 100644 --- a/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java +++ b/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java @@ -32,7 +32,7 @@ import java.io.IOException; */ public class TrackingConcurrentMergeScheduler extends ConcurrentMergeScheduler { - private final ESLogger logger; + protected final ESLogger logger; private final MeanMetric totalMerges = new MeanMetric(); private final CounterMetric totalMergesNumDocs = new CounterMetric(); diff --git a/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java b/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java index 2f778d4859c..84a8b0a6b96 100644 --- a/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java +++ b/modules/elasticsearch/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java @@ -29,7 +29,7 @@ import java.io.IOException; // LUCENE MONITOR - Copied from SerialMergeScheduler public class TrackingSerialMergeScheduler extends MergeScheduler { - private final ESLogger logger; + protected final ESLogger logger; private final MeanMetric totalMerges = new MeanMetric(); private final CounterMetric totalMergesNumDocs = new CounterMetric(); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/ConcurrentMergeSchedulerProvider.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/ConcurrentMergeSchedulerProvider.java index e5efdd16733..7689f2f0782 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/ConcurrentMergeSchedulerProvider.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/ConcurrentMergeSchedulerProvider.java @@ -97,7 +97,12 @@ public class ConcurrentMergeSchedulerProvider extends AbstractIndexShardComponen // since we do it outside of a lock in the RobinEngine return; } - super.merge(writer); + try { + super.merge(writer); + } catch (IOException e) { + logger.warn("failed to merge", e); + throw e; + } } @Override protected MergeThread getMergeThread(IndexWriter writer, MergePolicy.OneMerge merge) throws IOException { @@ -106,6 +111,11 @@ public class ConcurrentMergeSchedulerProvider extends AbstractIndexShardComponen return thread; } + @Override protected void handleMergeException(Throwable exc) { + logger.warn("failed to merge", exc); + super.handleMergeException(exc); + } + @Override public void close() { super.close(); provider.schedulers.remove(this); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/SerialMergeSchedulerProvider.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/SerialMergeSchedulerProvider.java index 4c3ab9bb305..860fcd4feb3 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/SerialMergeSchedulerProvider.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/merge/scheduler/SerialMergeSchedulerProvider.java @@ -87,7 +87,12 @@ public class SerialMergeSchedulerProvider extends AbstractIndexShardComponent im // since we do it outside of a lock in the RobinEngine return; } - super.merge(writer); + try { + super.merge(writer); + } catch (IOException e) { + logger.warn("failed to merge", e); + throw e; + } } @Override public void close() {