Merge pull request #15572 from s1monw/issues/15570
Remove `index.merge.scheduler.notify_on_failure` and default to `true`
This commit is contained in:
commit
67c2f4224c
|
@ -1129,20 +1129,18 @@ public class InternalEngine extends Engine {
|
||||||
@Override
|
@Override
|
||||||
protected void handleMergeException(final Directory dir, final Throwable exc) {
|
protected void handleMergeException(final Directory dir, final Throwable exc) {
|
||||||
logger.error("failed to merge", exc);
|
logger.error("failed to merge", exc);
|
||||||
if (config().getMergeSchedulerConfig().isNotifyOnMergeFailure()) {
|
engineConfig.getThreadPool().generic().execute(new AbstractRunnable() {
|
||||||
engineConfig.getThreadPool().generic().execute(new AbstractRunnable() {
|
@Override
|
||||||
@Override
|
public void onFailure(Throwable t) {
|
||||||
public void onFailure(Throwable t) {
|
logger.debug("merge failure action rejected", t);
|
||||||
logger.debug("merge failure action rejected", t);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doRun() throws Exception {
|
protected void doRun() throws Exception {
|
||||||
MergePolicy.MergeException e = new MergePolicy.MergeException(exc, dir);
|
MergePolicy.MergeException e = new MergePolicy.MergeException(exc, dir);
|
||||||
failEngine("merge failed", e);
|
failEngine("merge failed", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,19 +55,16 @@ public final class MergeSchedulerConfig {
|
||||||
public static final String MAX_THREAD_COUNT = "index.merge.scheduler.max_thread_count";
|
public static final String MAX_THREAD_COUNT = "index.merge.scheduler.max_thread_count";
|
||||||
public static final String MAX_MERGE_COUNT = "index.merge.scheduler.max_merge_count";
|
public static final String MAX_MERGE_COUNT = "index.merge.scheduler.max_merge_count";
|
||||||
public static final String AUTO_THROTTLE = "index.merge.scheduler.auto_throttle";
|
public static final String AUTO_THROTTLE = "index.merge.scheduler.auto_throttle";
|
||||||
public static final String NOTIFY_ON_MERGE_FAILURE = "index.merge.scheduler.notify_on_failure"; // why would we not wanna do this?
|
|
||||||
|
|
||||||
private volatile boolean autoThrottle;
|
private volatile boolean autoThrottle;
|
||||||
private volatile int maxThreadCount;
|
private volatile int maxThreadCount;
|
||||||
private volatile int maxMergeCount;
|
private volatile int maxMergeCount;
|
||||||
private final boolean notifyOnMergeFailure;
|
|
||||||
|
|
||||||
public MergeSchedulerConfig(IndexSettings indexSettings) {
|
public MergeSchedulerConfig(IndexSettings indexSettings) {
|
||||||
final Settings settings = indexSettings.getSettings();
|
final Settings settings = indexSettings.getSettings();
|
||||||
maxThreadCount = settings.getAsInt(MAX_THREAD_COUNT, Math.max(1, Math.min(4, EsExecutors.boundedNumberOfProcessors(settings) / 2)));
|
maxThreadCount = settings.getAsInt(MAX_THREAD_COUNT, Math.max(1, Math.min(4, EsExecutors.boundedNumberOfProcessors(settings) / 2)));
|
||||||
maxMergeCount = settings.getAsInt(MAX_MERGE_COUNT, maxThreadCount + 5);
|
maxMergeCount = settings.getAsInt(MAX_MERGE_COUNT, maxThreadCount + 5);
|
||||||
this.autoThrottle = settings.getAsBoolean(AUTO_THROTTLE, true);
|
this.autoThrottle = settings.getAsBoolean(AUTO_THROTTLE, true);
|
||||||
notifyOnMergeFailure = settings.getAsBoolean(NOTIFY_ON_MERGE_FAILURE, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,11 +111,4 @@ public final class MergeSchedulerConfig {
|
||||||
public void setMaxMergeCount(int maxMergeCount) {
|
public void setMaxMergeCount(int maxMergeCount) {
|
||||||
this.maxMergeCount = maxMergeCount;
|
this.maxMergeCount = maxMergeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns <code>true</code> iff we fail the engine on a merge failure. Default is <code>true</code>
|
|
||||||
*/
|
|
||||||
public boolean isNotifyOnMergeFailure() {
|
|
||||||
return notifyOnMergeFailure;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue