When a shard becomes search active then trigger a refresh instead of waiting for the next scheduled refresh.
The `IndexShard#awaitShardSearchActive(...)` method registers a refresh listener and then often waits for the refresh scheduler to trigger a refresh. By default this is one second. In order to avoid increasing the query time of the Search API, the mentioned method should trigger a refresh instead for waiting it to happen.

As part of this change we also need to disable the refresh scheduler completely. Otherwise we run at risk of running two refreshes next after each other. One triggered from making shard search active and one from the refresh scheduler.  



server/src/main/java/org/elasticsearch/index/shard/IndexShard.java
/*
             * This can happen during recovery when the shard has started its engine but recovery is not finalized and is receiving global
             * checkpoint updates. However, since this shard is not yet contributing to calculating the global checkpoint, it can be the
             * case that the global checkpoint update from the primary is ahead of the local checkpoint on this shard. In this case, we
             * ignore the global checkpoint update. This can happen if we are in the translog stage of recovery. Prior to this, the engine
             * is not opened and this shard will not receive global checkpoint updates, and after this the shard will be contributing to
             * calculations of the global checkpoint. However, we can not assert that we are in the translog stage of recovery here as
             * while the global checkpoint update may have emanated from the primary when we were in that state, we could subsequently move
             * to recovery finalization, or even finished recovery before the update arrives here.
             */
            assert state() != IndexShardState.POST_RECOVERY && state() != IndexShardState.STARTED
                : "supposedly in-sync shard copy received a global checkpoint ["
                    + globalCheckpoint
                    + "] "
                    + "that is higher than its local checkpoint ["
                    + localCheckpoint
                    + "]";
            return;
        }
        replicationTracker.updateGlobalCheckpointOnReplica(globalCheckpoint, reason);
    }
    private final AtomicInteger outstandingCleanFilesConditions = new AtomicInteger(0);
    private final Deque<Runnable> afterCleanFilesActions = new LinkedList<>();
    /**
     * Creates a {@link Runnable} that must be executed before the clean files step in peer recovery can complete.
     *
     * @return runnable that must be executed during the clean files step in peer recovery
     */
    public Runnable addCleanFilesDependency() {
        logger.trace("adding clean files dependency for [{}]", shardRouting);