@@ -451,7 +451,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, final Cl
451
451
public TimeValue timeout () {
452
452
return request .clusterManagerNodeTimeout ();
453
453
}
454
- }, "create_snapshot [" + snapshotName + ']' , listener ::onFailure );
454
+ }, "create_snapshot [" + snapshotName + ']' , () -> repositoriesService . repository ( request . repository ()), listener ::onFailure );
455
455
}
456
456
457
457
/**
@@ -640,7 +640,7 @@ public TimeValue timeout() {
640
640
return request .clusterManagerNodeTimeout ();
641
641
}
642
642
643
- }, "create_snapshot [" + snapshotName + ']' , listener ::onFailure );
643
+ }, "create_snapshot [" + snapshotName + ']' , () -> repositoriesService . repository ( repositoryName ), listener ::onFailure );
644
644
}
645
645
646
646
private void cleanOrphanTimestamp (String repoName , RepositoryData repositoryData ) {
@@ -1062,7 +1062,11 @@ public void onFailure(Exception e) {
1062
1062
public TimeValue timeout () {
1063
1063
return request .clusterManagerNodeTimeout ();
1064
1064
}
1065
- }, "clone_snapshot_v2 [" + request .source () + "][" + snapshotName + ']' , listener ::onFailure );
1065
+ },
1066
+ "clone_snapshot_v2 [" + request .source () + "][" + snapshotName + ']' ,
1067
+ () -> repositoriesService .repository (repositoryName ),
1068
+ listener ::onFailure
1069
+ );
1066
1070
}
1067
1071
1068
1072
// TODO: It is worth revisiting the design choice of creating a placeholder entry in snapshots-in-progress here once we have a cache
@@ -1148,14 +1152,18 @@ public void onFailure(String source, Exception e) {
1148
1152
public void clusterStateProcessed (String source , ClusterState oldState , final ClusterState newState ) {
1149
1153
logger .info ("snapshot clone [{}] started" , snapshot );
1150
1154
addListener (snapshot , ActionListener .wrap (r -> listener .onResponse (null ), listener ::onFailure ));
1151
- startCloning (repository , newEntry );
1155
+ startCloning (repository , repositoryName , newEntry );
1152
1156
}
1153
1157
1154
1158
@ Override
1155
1159
public TimeValue timeout () {
1156
1160
return request .clusterManagerNodeTimeout ();
1157
1161
}
1158
- }, "clone_snapshot [" + request .source () + "][" + snapshotName + ']' , listener ::onFailure );
1162
+ },
1163
+ "clone_snapshot [" + request .source () + "][" + snapshotName + ']' ,
1164
+ () -> repositoriesService .repository (repositoryName ),
1165
+ listener ::onFailure
1166
+ );
1159
1167
}
1160
1168
1161
1169
private static void ensureNoCleanupInProgress (ClusterState currentState , String repositoryName , String snapshotName ) {
@@ -1189,7 +1197,7 @@ private static void ensureSnapshotNameAvailableInRepo(RepositoryData repositoryD
1189
1197
* @param repository repository to run operation on
1190
1198
* @param cloneEntry clone operation in the cluster state
1191
1199
*/
1192
- private void startCloning (Repository repository , SnapshotsInProgress .Entry cloneEntry ) {
1200
+ private void startCloning (Repository repository , String repositoryName , SnapshotsInProgress .Entry cloneEntry ) {
1193
1201
final List <IndexId > indices = cloneEntry .indices ();
1194
1202
final SnapshotId sourceSnapshot = cloneEntry .source ();
1195
1203
final Snapshot targetSnapshot = cloneEntry .snapshot ();
@@ -1310,7 +1318,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
1310
1318
logger .warn ("Did not find expected entry [{}] in the cluster state" , cloneEntry );
1311
1319
}
1312
1320
}
1313
- }, "start snapshot clone" , onFailure ), onFailure );
1321
+ }, "start snapshot clone" , () -> repositoriesService . repository ( repositoryName ), onFailure ), onFailure );
1314
1322
}
1315
1323
1316
1324
private final Set <RepositoryShardId > currentlyCloning = Collections .synchronizedSet (new HashSet <>());
@@ -2639,7 +2647,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
2639
2647
public TimeValue timeout () {
2640
2648
return request .clusterManagerNodeTimeout ();
2641
2649
}
2642
- }, "delete snapshot" , listener ::onFailure );
2650
+ }, "delete snapshot" , () -> repositoriesService . repository ( repoName ), listener ::onFailure );
2643
2651
}
2644
2652
2645
2653
private static List <SnapshotId > matchingSnapshotIds (
0 commit comments