@@ -265,6 +265,9 @@ public static class SnapshotRecoverySource extends RecoverySource {
265265 private final boolean isSearchableSnapshot ;
266266 private final boolean remoteStoreIndexShallowCopy ;
267267 private final String sourceRemoteStoreRepository ;
268+ private final String sourceRemoteTranslogRepository ;
269+
270+ private final long pinnedTimestamp ;
268271
269272 public SnapshotRecoverySource (String restoreUUID , Snapshot snapshot , Version version , IndexId indexId ) {
270273 this (restoreUUID , snapshot , version , indexId , false , false , null );
@@ -278,6 +281,30 @@ public SnapshotRecoverySource(
278281 boolean isSearchableSnapshot ,
279282 boolean remoteStoreIndexShallowCopy ,
280283 @ Nullable String sourceRemoteStoreRepository
284+ ) {
285+ this (
286+ restoreUUID ,
287+ snapshot ,
288+ version ,
289+ indexId ,
290+ isSearchableSnapshot ,
291+ remoteStoreIndexShallowCopy ,
292+ sourceRemoteStoreRepository ,
293+ null ,
294+ 0L
295+ );
296+ }
297+
298+ public SnapshotRecoverySource (
299+ String restoreUUID ,
300+ Snapshot snapshot ,
301+ Version version ,
302+ IndexId indexId ,
303+ boolean isSearchableSnapshot ,
304+ boolean remoteStoreIndexShallowCopy ,
305+ @ Nullable String sourceRemoteStoreRepository ,
306+ @ Nullable String sourceRemoteTranslogRepository ,
307+ long pinnedTimestamp
281308 ) {
282309 this .restoreUUID = restoreUUID ;
283310 this .snapshot = Objects .requireNonNull (snapshot );
@@ -286,6 +313,8 @@ public SnapshotRecoverySource(
286313 this .isSearchableSnapshot = isSearchableSnapshot ;
287314 this .remoteStoreIndexShallowCopy = remoteStoreIndexShallowCopy ;
288315 this .sourceRemoteStoreRepository = sourceRemoteStoreRepository ;
316+ this .sourceRemoteTranslogRepository = sourceRemoteTranslogRepository ;
317+ this .pinnedTimestamp = pinnedTimestamp ;
289318 }
290319
291320 SnapshotRecoverySource (StreamInput in ) throws IOException {
@@ -309,6 +338,13 @@ public SnapshotRecoverySource(
309338 remoteStoreIndexShallowCopy = false ;
310339 sourceRemoteStoreRepository = null ;
311340 }
341+ if (in .getVersion ().onOrAfter (Version .V_2_17_0 )) {
342+ sourceRemoteTranslogRepository = in .readOptionalString ();
343+ pinnedTimestamp = in .readLong ();
344+ } else {
345+ sourceRemoteTranslogRepository = null ;
346+ pinnedTimestamp = 0L ;
347+ }
312348 }
313349
314350 public String restoreUUID () {
@@ -341,10 +377,18 @@ public String sourceRemoteStoreRepository() {
341377 return sourceRemoteStoreRepository ;
342378 }
343379
380+ public String sourceRemoteTranslogRepository () {
381+ return sourceRemoteTranslogRepository ;
382+ }
383+
344384 public boolean remoteStoreIndexShallowCopy () {
345385 return remoteStoreIndexShallowCopy ;
346386 }
347387
388+ public long pinnedTimestamp () {
389+ return pinnedTimestamp ;
390+ }
391+
348392 @ Override
349393 protected void writeAdditionalFields (StreamOutput out ) throws IOException {
350394 out .writeString (restoreUUID );
@@ -362,6 +406,10 @@ protected void writeAdditionalFields(StreamOutput out) throws IOException {
362406 out .writeBoolean (remoteStoreIndexShallowCopy );
363407 out .writeOptionalString (sourceRemoteStoreRepository );
364408 }
409+ if (out .getVersion ().onOrAfter (Version .V_2_17_0 )) {
410+ out .writeOptionalString (sourceRemoteTranslogRepository );
411+ out .writeLong (pinnedTimestamp );
412+ }
365413 }
366414
367415 @ Override
@@ -378,7 +426,8 @@ public void addAdditionalFields(XContentBuilder builder, ToXContent.Params param
378426 .field ("restoreUUID" , restoreUUID )
379427 .field ("isSearchableSnapshot" , isSearchableSnapshot )
380428 .field ("remoteStoreIndexShallowCopy" , remoteStoreIndexShallowCopy )
381- .field ("sourceRemoteStoreRepository" , sourceRemoteStoreRepository );
429+ .field ("sourceRemoteStoreRepository" , sourceRemoteStoreRepository )
430+ .field ("sourceRemoteTranslogRepository" , sourceRemoteTranslogRepository );
382431 }
383432
384433 @ Override
@@ -403,8 +452,11 @@ public boolean equals(Object o) {
403452 && isSearchableSnapshot == that .isSearchableSnapshot
404453 && remoteStoreIndexShallowCopy == that .remoteStoreIndexShallowCopy
405454 && sourceRemoteStoreRepository != null
406- ? sourceRemoteStoreRepository .equals (that .sourceRemoteStoreRepository )
407- : that .sourceRemoteStoreRepository == null ;
455+ ? sourceRemoteStoreRepository .equals (that .sourceRemoteStoreRepository )
456+ : that .sourceRemoteStoreRepository == null && sourceRemoteTranslogRepository != null
457+ ? sourceRemoteTranslogRepository .equals (that .sourceRemoteTranslogRepository )
458+ : that .sourceRemoteTranslogRepository == null && pinnedTimestamp == that .pinnedTimestamp ;
459+
408460 }
409461
410462 @ Override
@@ -416,10 +468,11 @@ public int hashCode() {
416468 version ,
417469 isSearchableSnapshot ,
418470 remoteStoreIndexShallowCopy ,
419- sourceRemoteStoreRepository
471+ sourceRemoteStoreRepository ,
472+ sourceRemoteTranslogRepository ,
473+ pinnedTimestamp
420474 );
421475 }
422-
423476 }
424477
425478 /**
0 commit comments