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 904fe1d commit 015ae30
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,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 015ae30

Please sign in to comment.