Skip to content

Commit

Permalink
Remove deprecated controller hot-standby mode. (apache#3266)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbickel authored and markusthoemmes committed Feb 16, 2018
1 parent a8434b7 commit 966c091
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 18 deletions.
4 changes: 1 addition & 3 deletions ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exclude_logs_from: []
# whisk_api_localhost_name_default (last)
whisk_api_localhost_name_default: "localhost"

hosts_dir: "{{ inventory_dir| default(env_hosts_dir) }}"
hosts_dir: "{{ inventory_dir| default(env_hosts_dir) }}"

whisk:
version:
Expand Down Expand Up @@ -54,8 +54,6 @@ controller:
bindPort: 2551
# at this moment all controllers are seed nodes
seedNodes: "{{ groups['controllers'] | map('extract', hostvars, 'ansible_host') | list }}"
# We recommend to enable HA for the controllers only, if bookkeeping data are shared too. (localBookkeeping: false)
ha: "{{ controller_enable_ha | default(True) and groups['controllers'] | length > 1 }}"
loadbalancer:
spi: "{{ controller_loadbalancer_spi | default('') }}"
loglevel: "{{ controller_loglevel | default(whisk_loglevel) | default('INFO') }}"
Expand Down
1 change: 0 additions & 1 deletion ansible/roles/controller/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@

"CONTROLLER_LOCALBOOKKEEPING": "{{ controller.localBookkeeping }}"
"AKKA_CLUSTER_SEED_NODES": "{{seed_nodes_list | join(' ') }}"
"CONTROLLER_HA": "{{ controller.ha }}"

"METRICS_KAMON": "{{ metrics.kamon.enabled }}"
"METRICS_LOG": "{{ metrics.log.enabled }}"
Expand Down
7 changes: 2 additions & 5 deletions ansible/roles/nginx/templates/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ http {
# Otherwise, nginx would dispatch requests when the container is up, but the backend in the container not.
# From the docs:
# "normally, requests with a non-idempotent method (POST, LOCK, PATCH) are not passed to the next server if a request has been sent to an upstream server"
server {{ hostvars[groups['controllers'] | first].ansible_host }}:{{ controller.basePort }} fail_timeout=60s;
{% for ip in groups['controllers'] %}
{% if groups['controllers'].index(ip) > 0 %}
server {{ hostvars[ip].ansible_host }}:{{ controller.basePort + groups['controllers'].index(ip) }} {% if controller.ha %}fail_timeout=60s{% else %}backup{% endif %};
{% endif %}
{% for c in groups['controllers'] %}
server {{ hostvars[c].ansible_host }}:{{ controller.basePort + groups['controllers'].index(c) }} fail_timeout=60s;
{% endfor %}
keepalive 512;
}
Expand Down
1 change: 0 additions & 1 deletion ansible/templates/whisk.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ invoker.hosts.basePort={{ invoker.port }}
controller.hosts={{ groups["controllers"] | map('extract', hostvars, 'ansible_host') | list | join(",") }}
controller.host.basePort={{ controller.basePort }}
controller.instances={{ controller.instances }}
controller.ha={{ controller.ha }}

invoker.container.network=bridge
invoker.container.policy={{ invoker_container_policy_name | default()}}
Expand Down
2 changes: 0 additions & 2 deletions common/scala/src/main/scala/whisk/core/WhiskConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class WhiskConfig(requiredProperties: Map[String, String],
val actionSequenceLimit = this(WhiskConfig.actionSequenceMaxLimit)
val controllerSeedNodes = this(WhiskConfig.controllerSeedNodes)
val controllerLocalBookkeeping = getAsBoolean(WhiskConfig.controllerLocalBookkeeping, false)
val controllerHighAvailability = getAsBoolean(WhiskConfig.controllerHighAvailability, false)
}

object WhiskConfig {
Expand Down Expand Up @@ -231,7 +230,6 @@ object WhiskConfig {
val triggerFirePerMinuteLimit = "limits.triggers.fires.perMinute"
val controllerSeedNodes = "akka.cluster.seed.nodes"
val controllerLocalBookkeeping = "controller.localBookkeeping"
val controllerHighAvailability = "controller.ha"
}

object ConfigKeys {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ protected[core] object EntitlementProvider {
WhiskConfig.actionInvokeConcurrentLimit -> null,
WhiskConfig.triggerFirePerMinuteLimit -> null,
WhiskConfig.actionInvokeSystemOverloadLimit -> null,
WhiskConfig.controllerInstances -> null,
WhiskConfig.controllerHighAvailability -> null)
WhiskConfig.controllerInstances -> null)
}

/**
Expand All @@ -85,7 +84,7 @@ protected[core] abstract class EntitlementProvider(config: WhiskConfig, loadBala
* Allows 20% of additional requests on top of the limit to mitigate possible unfair round-robin loadbalancing between
* controllers
*/
private val overcommit = if (config.controllerHighAvailability) 1.2 else 1
private val overcommit = if (config.controllerInstances.toInt > 1) 1.2 else 1
private def dilateLimit(limit: Int): Int = Math.ceil(limit.toDouble * overcommit).toInt

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ContainerPoolBalancer(config: WhiskConfig, controllerInstance: InstanceId)

override def totalActiveActivations = loadBalancerData.totalActivationCount

override def clusterSize = if (config.controllerHighAvailability) config.controllerInstances.toInt else 1
override def clusterSize = config.controllerInstances.toInt

/**
* Tries to fill in the result slot (i.e., complete the promise) when a completion message arrives.
Expand Down
3 changes: 1 addition & 2 deletions tests/src/test/scala/limits/ThrottleTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import common.WskProps
import common.WskTestHelpers
import spray.json._
import spray.json.DefaultJsonProtocol._
import whisk.core.WhiskConfig
import whisk.http.Messages._
import whisk.utils.ExecutionContextFactory
import whisk.utils.retry
Expand Down Expand Up @@ -74,7 +73,7 @@ class ThrottleTests
val throttleWindow = 1.minute

// Due to the overhead of the per minute limit in the controller, we add this overhead here as well.
val overhead = if (WhiskProperties.getProperty(WhiskConfig.controllerHighAvailability).toBoolean) 1.2 else 1.0
val overhead = if (WhiskProperties.getControllerHosts.split(",").length > 1) 1.2 else 1.0
val maximumInvokesPerMinute = math.ceil(getLimit("limits.actions.invokes.perMinute") * overhead).toInt
val maximumFiringsPerMinute = math.ceil(getLimit("limits.triggers.fires.perMinute") * overhead).toInt
val maximumConcurrentInvokes = getLimit("limits.actions.invokes.concurrent")
Expand Down

0 comments on commit 966c091

Please sign in to comment.