File tree 1 file changed +2
-5
lines changed
server/src/main/java/org/elasticsearch/indices/recovery
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -282,17 +282,14 @@ && isTargetSameHistory()
282
282
ThreadPool .Names .GENERIC , establishRetentionLeaseStep , false ));
283
283
}, shardId + " establishing retention lease for [" + request .targetAllocationId () + "]" ,
284
284
shard , cancellableThreads , logger );
285
+ // all the history we need is now retained by a retention lease so we can close the retention lock
286
+ retentionLock .close ();
285
287
} else {
286
288
establishRetentionLeaseStep .onResponse (null );
287
289
}
288
290
}, onFailure );
289
291
290
292
establishRetentionLeaseStep .whenComplete (r -> {
291
- if (useRetentionLeases && isSequenceNumberBasedRecovery == false ) {
292
- // all the history we need is now retained by a retention lease so we can close the retention lock
293
- retentionLock .close ();
294
- }
295
-
296
293
assert Transports .assertNotTransportThread (RecoverySourceHandler .this + "[prepareTargetForTranslog]" );
297
294
// For a sequence based recovery, the target can keep its local translog
298
295
prepareTargetForTranslog (isSequenceNumberBasedRecovery == false ,
You can’t perform that action at this time.
0 commit comments