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
"detected new primary with primary term [{}], global checkpoint [{}], max_seq_no [{}]",
                            opPrimaryTerm,
                            currentGlobalCheckpoint,
                            maxSeqNo
                        );
                        if (currentGlobalCheckpoint < maxSeqNo) {
                            resetEngineToGlobalCheckpoint();
                        } else {
                            getEngine().rollTranslogGeneration();
                        }
                    }, allowCombineOperationWithPrimaryTermUpdate ? operationListener : null);
                    if (allowCombineOperationWithPrimaryTermUpdate) {
                        logger.debug("operation execution has been combined with primary term update");
                        return;
                    }
                }
            }
        }
        assert opPrimaryTerm <= pendingPrimaryTerm
            : "operation primary term [" + opPrimaryTerm + "] should be at most [" + pendingPrimaryTerm + "]";
        operationExecutor.accept(operationListener);
    }
    private boolean requirePrimaryTermUpdate(final long opPrimaryTerm, final boolean allPermits) {
        return (opPrimaryTerm > pendingPrimaryTerm) || (allPermits && opPrimaryTerm > getOperationPrimaryTerm());
    }
    public static final int OPERATIONS_BLOCKED = -1;
    /**
     * Obtain the active operation count, or {@link IndexShard#OPERATIONS_BLOCKED} if all permits are held (even if there are
     * outstanding operations in flight).
     *