diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index bfc3319ada1..84e4a58545a 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -594,6 +594,9 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus } private static ShardGenerations buildGenerations(SnapshotsInProgress.Entry snapshot) { + if (snapshot.useShardGenerations() == false) { + return ShardGenerations.EMPTY; + } ShardGenerations.Builder builder = ShardGenerations.builder(); final Map indexLookup = new HashMap<>(); snapshot.indices().forEach(idx -> indexLookup.put(idx.getName(), idx));