mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 06:16:40 +00:00
Log warning when application of an updated cluster state fails with an exception
This commit is contained in:
parent
e7baf30bd2
commit
ed8c289dec
@ -212,6 +212,7 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
|
||||
return;
|
||||
}
|
||||
if (previousClusterState != clusterState) {
|
||||
try {
|
||||
if (clusterState.nodes().localNodeMaster()) {
|
||||
// only the master controls the version numbers
|
||||
Builder builder = ClusterState.builder().state(clusterState).version(clusterState.version() + 1);
|
||||
@ -293,6 +294,13 @@ public class InternalClusterService extends AbstractLifecycleComponent<ClusterSe
|
||||
}
|
||||
|
||||
logger.debug("processing [{}]: done applying updated cluster_state", source);
|
||||
} catch (Exception e) {
|
||||
StringBuilder sb = new StringBuilder("failed to apply updated cluster state:\nversion [").append(clusterState.version()).append("], source [").append(source).append("]\n");
|
||||
sb.append(clusterState.nodes().prettyPrint());
|
||||
sb.append(clusterState.routingTable().prettyPrint());
|
||||
sb.append(clusterState.readOnlyRoutingNodes().prettyPrint());
|
||||
logger.warn(sb.toString(), e);
|
||||
}
|
||||
} else {
|
||||
logger.debug("processing [{}]: no change in cluster_state", source);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user