Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.elasticsearch.action.support.TransportActions;
import org.elasticsearch.cluster.ProjectState;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.ResolvedExpression;
import org.elasticsearch.cluster.routing.RecoverySource;
import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.CheckedSupplier;
Expand Down Expand Up @@ -531,7 +532,7 @@ public void beforeIndexShardCreated(ShardRouting routing, Settings indexSettings
// to stop searches to restore full availability as fast as possible. A known scenario here is that we lost connection to master
// or master(s) were restarted.
assert routing.initializing();
if (routing.isRelocationTarget() == false) {
if (routing.isRelocationTarget() == false && routing.recoverySource() != RecoverySource.EmptyStoreRecoverySource.INSTANCE) {
freeAllContextsForShard(routing.shardId());
}
}
Expand Down