/** * Balances the nodes on the cluster model according to the weight function. * The actual balancing is delegated to {@link #balanceByWeights()} */ private void balance() { if (logger.isTraceEnabled()) { logger.trace("Start balancing cluster"); } if (allocation.hasPendingAsyncFetch()) { /* * see https://github.com/elastic/elasticsearch/issues/14387 * if we allow rebalance operations while we are still fetching shard store data * we might end up with unnecessary rebalance operations which can be super confusion/frustrating * since once the fetches come back we might just move all the shards back again. * Therefore we only do a rebalance if we have fetched all information. */ logger.debug("skipping rebalance due to in-flight shard/store fetches"); return; } if (allocation.deciders().canRebalance(allocation).type() != Type.YES) { logger.trace("skipping rebalance as it is disabled"); return; } if (nodes.size() < 2) { /* skip if we only have one node */ logger.trace("skipping rebalance as single node only"); return; } balanceByWeights(); }
nodeResults = buildNodeDecisions(nodesToAllocate, shardState, inSyncAllocationIds); if (allocation.hasPendingAsyncFetch()) { return AllocateUnassignedDecision.no(AllocationStatus.FETCHING_SHARD_DATA, nodeResults); } else if (node != null) {
if (canRebalance.type() != Type.YES || allocation.hasPendingAsyncFetch()) { AllocationDecision allocationDecision = allocation.hasPendingAsyncFetch() ? AllocationDecision.AWAITING_INFO : AllocationDecision.fromDecisionType(canRebalance.type()); return MoveDecision.cannotRebalance(canRebalance, allocationDecision, currentNodeWeightRanking, nodeDecisions);
@Override public boolean rebalance(RoutingAllocation allocation) { if (allocation.hasPendingAsyncFetch() == false) { /* * see https://github.com/elastic/elasticsearch/issues/14387 * if we allow rebalance operations while we are still fetching shard store data * we might end up with unnecessary rebalance operations which can be super confusion/frustrating * since once the fetches come back we might just move all the shards back again. * Therefore we only do a rebalance if we have fetched all information. */ return allocator.rebalance(allocation); } else { logger.debug("skipping rebalance due to in-flight shard/store fetches"); return false; } }
/** * Balances the nodes on the cluster model according to the weight function. * The actual balancing is delegated to {@link #balanceByWeights()} */ private void balance() { if (logger.isTraceEnabled()) { logger.trace("Start balancing cluster"); } if (allocation.hasPendingAsyncFetch()) { /* * see https://github.com/elastic/elasticsearch/issues/14387 * if we allow rebalance operations while we are still fetching shard store data * we might end up with unnecessary rebalance operations which can be super confusion/frustrating * since once the fetches come back we might just move all the shards back again. * Therefore we only do a rebalance if we have fetched all information. */ logger.debug("skipping rebalance due to in-flight shard/store fetches"); return; } if (allocation.deciders().canRebalance(allocation).type() != Type.YES) { logger.trace("skipping rebalance as it is disabled"); return; } if (nodes.size() < 2) { /* skip if we only have one node */ logger.trace("skipping rebalance as single node only"); return; } balanceByWeights(); }
/** * Balances the nodes on the cluster model according to the weight function. * The actual balancing is delegated to {@link #balanceByWeights()} */ private void balance() { if (logger.isTraceEnabled()) { logger.trace("Start balancing cluster"); } if (allocation.hasPendingAsyncFetch()) { /* * see https://github.com/elastic/elasticsearch/issues/14387 * if we allow rebalance operations while we are still fetching shard store data * we might end up with unnecessary rebalance operations which can be super confusion/frustrating * since once the fetches come back we might just move all the shards back again. * Therefore we only do a rebalance if we have fetched all information. */ logger.debug("skipping rebalance due to in-flight shard/store fetches"); return; } if (allocation.deciders().canRebalance(allocation).type() != Type.YES) { logger.trace("skipping rebalance as it is disabled"); return; } if (nodes.size() < 2) { /* skip if we only have one node */ logger.trace("skipping rebalance as single node only"); return; } balanceByWeights(); }
/** * Balances the nodes on the cluster model according to the weight function. * The actual balancing is delegated to {@link #balanceByWeights()} */ private void balance() { if (logger.isTraceEnabled()) { logger.trace("Start balancing cluster"); } if (allocation.hasPendingAsyncFetch()) { /* * see https://github.com/elastic/elasticsearch/issues/14387 * if we allow rebalance operations while we are still fetching shard store data * we might end up with unnecessary rebalance operations which can be super confusion/frustrating * since once the fetches come back we might just move all the shards back again. * Therefore we only do a rebalance if we have fetched all information. */ logger.debug("skipping rebalance due to in-flight shard/store fetches"); return; } if (allocation.deciders().canRebalance(allocation).type() != Type.YES) { logger.trace("skipping rebalance as it is disabled"); return; } if (nodes.size() < 2) { /* skip if we only have one node */ logger.trace("skipping rebalance as single node only"); return; } balanceByWeights(); }
nodeResults = buildNodeDecisions(nodesToAllocate, shardState, inSyncAllocationIds); if (allocation.hasPendingAsyncFetch()) { return AllocateUnassignedDecision.no(AllocationStatus.FETCHING_SHARD_DATA, nodeResults); } else if (node != null) {
nodeResults = buildNodeDecisions(nodesToAllocate, shardState, inSyncAllocationIds); if (allocation.hasPendingAsyncFetch()) { return AllocateUnassignedDecision.no(AllocationStatus.FETCHING_SHARD_DATA, nodeResults); } else if (node != null) {
nodeResults = buildNodeDecisions(nodesToAllocate, shardState, inSyncAllocationIds); if (allocation.hasPendingAsyncFetch()) { return AllocateUnassignedDecision.no(AllocationStatus.FETCHING_SHARD_DATA, nodeResults); } else if (node != null) {
if (canRebalance.type() != Type.YES || allocation.hasPendingAsyncFetch()) { AllocationDecision allocationDecision = allocation.hasPendingAsyncFetch() ? AllocationDecision.AWAITING_INFO : AllocationDecision.fromDecisionType(canRebalance.type()); return MoveDecision.cannotRebalance(canRebalance, allocationDecision, currentNodeWeightRanking, nodeDecisions);
if (canRebalance.type() != Type.YES || allocation.hasPendingAsyncFetch()) { AllocationDecision allocationDecision = allocation.hasPendingAsyncFetch() ? AllocationDecision.AWAITING_INFO : AllocationDecision.fromDecisionType(canRebalance.type()); return MoveDecision.cannotRebalance(canRebalance, allocationDecision, currentNodeWeightRanking, nodeDecisions);
if (canRebalance.type() != Type.YES || allocation.hasPendingAsyncFetch()) { AllocationDecision allocationDecision = allocation.hasPendingAsyncFetch() ? AllocationDecision.AWAITING_INFO : AllocationDecision.fromDecisionType(canRebalance.type()); return MoveDecision.cannotRebalance(canRebalance, allocationDecision, currentNodeWeightRanking, nodeDecisions);