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:
parent
35c546b388
commit
d8165a3439
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue