From f36691de4fe83bc2e365c5fdbd47d7eca85fdf30 Mon Sep 17 00:00:00 2001 From: Gaurav Bafna Date: Wed, 16 Oct 2024 16:28:36 +0530 Subject: [PATCH] Get Shard Generations from source metadata as well Signed-off-by: Gaurav Bafna --- .../main/java/org/opensearch/snapshots/SnapshotsService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java index 638eb3d7e1695..aef2bfa836f89 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java @@ -962,8 +962,6 @@ public void clusterStateProcessed(String source, ClusterState oldState, final Cl final Executor executor = threadPool.executor(ThreadPool.Names.SNAPSHOT); executor.execute(ActionRunnable.supply(snapshotInfoListener, () -> repository.getSnapshotInfo(sourceSnapshotId))); - final ShardGenerations shardGenerations = repositoryData.shardGenerations(); - snapshotInfoListener.whenComplete(snapshotInfo -> { final SnapshotInfo cloneSnapshotInfo = new SnapshotInfo( snapshot.getSnapshotId(), @@ -1000,6 +998,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, final Cl } ); metadataListener.whenComplete(meta -> { + ShardGenerations shardGenerations = buildGenerations(newEntry, meta); repository.finalizeSnapshot( shardGenerations, repositoryData.getGenId(),