removed retry start watcher mechanism
If nodes drop and .watches / .triggered_watches shards are available after those shards were started a new cluster state update will come along that triggers the start watcher logic. Original commit: elastic/x-pack-elasticsearch@af36f8b078
This commit is contained in:
parent
ca58e93150
commit
7a55a957d3
|
@ -78,30 +78,12 @@ public class WatcherLifeCycleService extends AbstractComponent implements Cluste
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int attempts = 0;
|
logger.trace("starting... (based on cluster state version [{}])", state.getVersion());
|
||||||
for (; attempts < 3; attempts++) {
|
|
||||||
try {
|
try {
|
||||||
if (logger.isDebugEnabled()) {
|
|
||||||
logger.debug("start attempt [{}]...", attempts);
|
|
||||||
} else if (logger.isTraceEnabled()) {
|
|
||||||
logger.trace("starting... (attempt [{}] - based on cluster state version [{}])", attempts, state.getVersion());
|
|
||||||
}
|
|
||||||
watcherService.start(state);
|
watcherService.start(state);
|
||||||
return;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("error occurred while starting, retrying...", e);
|
logger.debug("failed to start watcher. please wait for the cluster to become ready or try to start Watcher manually");
|
||||||
try {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
} catch (InterruptedException ie) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
}
|
||||||
if (!clusterService.localNode().masterNode()) {
|
|
||||||
logger.error("abort retry, we are no longer master");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logger.error("failed to start watcher. attempted to start [{}] times. please try to start Watcher manually", attempts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue