You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/10/18 02:27:22 UTC

[GitHub] [apisix] shuaijinchao opened a new pull request #5257: fix: etcd upgrade 1.6.0 after init back round robin

shuaijinchao opened a new pull request #5257:
URL: https://github.com/apache/apisix/pull/5257


   ### What this PR does / why we need it:
   
   After etcd is upgraded to 1.6.0, if it has been initialized in the default mode, the health check mode needs to be switched by judging whether the shared memory exists when performing the health check configuration.
   
   https://github.com/apache/apisix/blob/93038127c54235f5ac786b7ab10aee4231cffc4c/apisix/core/config_etcd.lua#L521
   
   https://github.com/api7/lua-resty-etcd/blob/9995f38e4da90af655528e6e8d40e3d6fa5bc946/health_check.md#L59
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] shuaijinchao commented on a change in pull request #5257: fix: etcd upgrade 1.6.0 after init back round robin

Posted by GitBox <gi...@apache.org>.
shuaijinchao commented on a change in pull request #5257:
URL: https://github.com/apache/apisix/pull/5257#discussion_r730610662



##########
File path: apisix/core/config_etcd.lua
##########
@@ -518,7 +518,7 @@ local function _automatic_fetch(premature, self)
         return
     end
 
-    if not health_check.conf then
+    if not health_check.conf or not health_check.conf.shm_name then

Review comment:
       updated




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander merged pull request #5257: fix: shm health check is not enabled after upgrading etcd client to 1.6.0

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #5257:
URL: https://github.com/apache/apisix/pull/5257


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #5257: fix: etcd upgrade 1.6.0 after init back round robin

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5257:
URL: https://github.com/apache/apisix/pull/5257#discussion_r730596333



##########
File path: apisix/core/config_etcd.lua
##########
@@ -518,7 +518,7 @@ local function _automatic_fetch(premature, self)
         return
     end
 
-    if not health_check.conf then
+    if not health_check.conf or not health_check.conf.shm_name then

Review comment:
       ```suggestion
       if not (health_check.conf and health_check.conf.shm_name) then
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] shuaijinchao commented on pull request #5257: fix: etcd upgrade 1.6.0 after init back round robin

Posted by GitBox <gi...@apache.org>.
shuaijinchao commented on pull request #5257:
URL: https://github.com/apache/apisix/pull/5257#issuecomment-945332665


   > Could you provide a test for it?
   
   OK


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #5257: fix: etcd upgrade 1.6.0 after init back round robin

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5257:
URL: https://github.com/apache/apisix/pull/5257#discussion_r730621459



##########
File path: t/core/config_etcd.t
##########
@@ -316,3 +316,29 @@ passed
 passed
 --- no_error_log
 [error]
+
+
+
+=== TEST 9: Test ETCD health check mode switch during APISIX startup
+apisix:
+  node_listen: 1984
+  admin_key: null
+etcd:
+  host:
+    - "http://127.0.0.1:2379"
+  tls:
+    verify: false
+  prefix: "/apisix"
+--- config
+    location /t {
+        content_by_lua_block {
+            ngx.say("passed")
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- grep_error_log_out

Review comment:
       Miss `grep_error_log`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org