improve logging of failure when merging
This commit is contained in:
parent
d7943e8ebd
commit
a8baec6960
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue