This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new dd7ee6f3b chore: adjust etcd max_fails for the admin api and add
comments (#7311)
dd7ee6f3b is described below
commit dd7ee6f3b2c9f28d3a1924d98b884af20384bb72
Author: tzssangglass <[email protected]>
AuthorDate: Mon Jun 27 10:43:25 2022 +0800
chore: adjust etcd max_fails for the admin api and add comments (#7311)
---
apisix/core/config_etcd.lua | 1 +
apisix/core/etcd.lua | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/apisix/core/config_etcd.lua b/apisix/core/config_etcd.lua
index 8736059f7..183c52aac 100644
--- a/apisix/core/config_etcd.lua
+++ b/apisix/core/config_etcd.lua
@@ -523,6 +523,7 @@ local function _automatic_fetch(premature, self)
end
if not (health_check.conf and health_check.conf.shm_name) then
+ -- used for worker processes to synchronize configuration
local _, err = health_check.init({
shm_name = health_check_shm_name,
fail_timeout = self.health_check_timeout,
diff --git a/apisix/core/etcd.lua b/apisix/core/etcd.lua
index 274b3a9d8..df26e04dc 100644
--- a/apisix/core/etcd.lua
+++ b/apisix/core/etcd.lua
@@ -85,10 +85,12 @@ local function new()
end
end
- -- enable etcd health check retry for curr worker
+ -- if an unhealthy etcd node is selected in a single admin read/write etcd
operation,
+ -- the retry mechanism for health check can select another healthy etcd
node
+ -- to complete the read/write etcd operation.
if not health_check.conf then
health_check.init({
- max_fails = #etcd_conf.http_host,
+ max_fails = 1,
retry = true,
})
end