Turn off translog retention only when shard started (#57063)

We should only turn off the translog retention when a shard is started; 
otherwise, we can issue unnecessary warn logs.
This commit is contained in:
Nhat Nguyen 2020-05-22 09:05:05 -04:00 committed by GitHub
parent 35c546b388
commit d8165a3439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -609,7 +609,7 @@ public class IndexShard extends AbstractIndexShardComponent implements IndicesCl
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