Skip to content

Commit 93cc8aa

Browse files
committed
More changes...
1 parent c691b69 commit 93cc8aa

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,21 @@ private void doRecovery(final long recoveryId, final StartRecoveryRequest preExi
301301
if (indexShard.routingEntry().isPromotableToPrimary() == false) {
302302
assert preExistingRequest == null;
303303
assert indexShard.indexSettings().getIndexMetadata().isSearchableSnapshot() == false;
304-
try (onCompletion) {
305-
client.execute(
306-
StatelessUnpromotableRelocationAction.TYPE,
307-
new StatelessUnpromotableRelocationAction.Request(
308-
recoveryId,
309-
indexShard.shardId(),
310-
indexShard.routingEntry().allocationId().getId(),
311-
recoveryTarget.clusterStateVersion()
312-
),
313-
cleanupOnly.delegateFailure((l, unused) -> {
314-
ActionListener.completeWith(l, () -> {
315-
onGoingRecoveries.markRecoveryAsDone(recoveryId);
316-
return null;
317-
});
318-
})
319-
);
320-
}
304+
client.execute(
305+
StatelessUnpromotableRelocationAction.TYPE,
306+
new StatelessUnpromotableRelocationAction.Request(
307+
recoveryId,
308+
indexShard.shardId(),
309+
indexShard.routingEntry().allocationId().getId(),
310+
recoveryTarget.clusterStateVersion()
311+
),
312+
cleanupOnly.delegateFailure((l, unused) -> {
313+
ActionListener.completeWith(l, () -> {
314+
onGoingRecoveries.markRecoveryAsDone(recoveryId);
315+
return null;
316+
});
317+
})
318+
);
321319
return;
322320
}
323321

0 commit comments

Comments
 (0)