Skip to content

Commit

Permalink
Turn off translog retention only when shard started (#57063)
Browse files Browse the repository at this point in the history
We should only turn off the translog retention when a shard is started; 
otherwise, we can issue unnecessary warn logs.
  • Loading branch information
dnhatn committed May 22, 2020
1 parent 676c8ae commit 107eb7e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ public void onFailure(Exception e) {
indexEventListener.shardRoutingChanged(this, currentRouting, newRouting);
}

if (indexSettings.isSoftDeleteEnabled() && useRetentionLeasesInPeerRecovery == false) {
if (indexSettings.isSoftDeleteEnabled() && useRetentionLeasesInPeerRecovery == false && state() == IndexShardState.STARTED) {
final RetentionLeases retentionLeases = replicationTracker.getRetentionLeases();
final Set<ShardRouting> shardRoutings = new HashSet<>(routingTable.getShards());
shardRoutings.addAll(routingTable.assignedShards()); // include relocation targets
Expand Down

0 comments on commit 107eb7e

Please sign in to comment.