File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed 
server/src/main/java/org/elasticsearch/snapshots Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4457,9 +4457,14 @@ private SnapshotsInProgress createSnapshot(
44574457    }
44584458
44594459    private  Collection <LongWithAttributes > getSnapshotsInProgress () {
4460-         final  SnapshotsInProgress  snapshotsInProgress  = SnapshotsInProgress .get (clusterService .state ());
4460+         final  ClusterState  currentState  = clusterService .state ();
4461+         // Only the master should report on snapshots-in-progress 
4462+         if  (currentState .nodes ().isLocalNodeElectedMaster () == false ) {
4463+             return  List .of ();
4464+         }
4465+         final  SnapshotsInProgress  snapshotsInProgress  = SnapshotsInProgress .get (currentState );
44614466        final  List <LongWithAttributes > snapshotsInProgressMetrics  = new  ArrayList <>();
4462-         clusterService . state () .metadata ().projects ().forEach ((projectId , project ) -> {
4467+         currentState .metadata ().projects ().forEach ((projectId , project ) -> {
44634468            RepositoriesMetadata  repositoriesMetadata  = RepositoriesMetadata .get (project );
44644469            if  (repositoriesMetadata  != null ) {
44654470                repositoriesMetadata .repositories ().forEach (repository  -> {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments