File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
x-pack/plugin/slm/src/main/java/org/elasticsearch/xpack/slm Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 77
88package org .elasticsearch .xpack .slm ;
99
10+ import org .apache .logging .log4j .Level ;
1011import org .apache .logging .log4j .LogManager ;
1112import org .apache .logging .log4j .Logger ;
1213import org .elasticsearch .ElasticsearchException ;
1920import org .elasticsearch .client .internal .OriginSettingClient ;
2021import org .elasticsearch .cluster .ClusterState ;
2122import org .elasticsearch .cluster .ClusterStateUpdateTask ;
23+ import org .elasticsearch .cluster .NotMasterException ;
2224import org .elasticsearch .cluster .ProjectState ;
2325import org .elasticsearch .cluster .SnapshotsInProgress ;
2426import org .elasticsearch .cluster .metadata .ProjectId ;
@@ -589,11 +591,14 @@ public ClusterState execute(ClusterState currentState) throws Exception {
589591
590592 @ Override
591593 public void onFailure (Exception e ) {
592- logger .error (
593- "failed to record snapshot policy execution status [{}] for snapshot [{}] in policy [{}]: {}" ,
594- exception .isPresent () ? "failure" : "success" ,
595- snapshotId .getName (),
596- policyName ,
594+ logger .log (
595+ e instanceof NotMasterException ? Level .INFO : Level .ERROR ,
596+ format (
597+ "failed to record snapshot policy execution status [%s] for snapshot [%s] in policy [%s]" ,
598+ exception .isPresent () ? "failure" : "success" ,
599+ snapshotId .getName (),
600+ policyName
601+ ),
597602 e
598603 );
599604 }
You can’t perform that action at this time.
0 commit comments