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 2020/11/10 06:57:22 UTC

[GitHub] [apisix] spacewander opened a new pull request #2687: fix(etcd): handle etcd compaction

spacewander opened a new pull request #2687:
URL: https://github.com/apache/apisix/pull/2687


   Close #2680.
   
   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   * [ ] 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?
   * [ ] Is this PR backward compatible?
   


----------------------------------------------------------------
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.

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



[GitHub] [apisix] membphis commented on a change in pull request #2687: fix(etcd): handle etcd compaction

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



##########
File path: apisix/core/etcd.lua
##########
@@ -118,6 +118,14 @@ function _M.watch_format(v3res)
     v2res.body = {
         node = {}
     }
+
+    local compact_revision = v3res.result.compact_revision
+    if compact_revision and tonumber(compact_revision) > 0 then
+        -- When the revisions are compacted, there might be compacted changes

Review comment:
       add a todo comment, missing test cases, will add later




----------------------------------------------------------------
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.

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



[GitHub] [apisix] spacewander commented on a change in pull request #2687: fix(etcd): handle etcd compaction

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



##########
File path: apisix/core/etcd.lua
##########
@@ -118,6 +118,14 @@ function _M.watch_format(v3res)
     v2res.body = {
         node = {}
     }
+
+    local compact_revision = v3res.result.compact_revision
+    if compact_revision and tonumber(compact_revision) > 0 then
+        -- When the revisions are compacted, there might be compacted changes

Review comment:
       @membphis 
   Solved.




----------------------------------------------------------------
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.

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



[GitHub] [apisix] spacewander commented on pull request #2687: fix(etcd): handle etcd compaction

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


   @ShiningRush 
   Yes, it is how I reproduce it. But in the local machine, the sync is so fast that you don't have enough time to reconnect before sync the data. (This is why I need to try many times manually). It would be worse in the CI environment.


----------------------------------------------------------------
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.

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



[GitHub] [apisix] ShiningRush commented on pull request #2687: fix(etcd): handle etcd compaction

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


   We can make a test case for the situation.


----------------------------------------------------------------
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.

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



[GitHub] [apisix] spacewander commented on pull request #2687: fix(etcd): handle etcd compaction

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


   @ShiningRush 
   It is too tough to provide a stable test case. I have to run several times manually to reproduce the issue.


----------------------------------------------------------------
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.

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



[GitHub] [apisix] membphis merged pull request #2687: fix(etcd): handle etcd compaction

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


   


----------------------------------------------------------------
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.

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



[GitHub] [apisix] ShiningRush commented on pull request #2687: fix(etcd): handle etcd compaction

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


   I think it may not so tough, it should reproduce by follow steps:
   - update the some key
   - manually compact etcd by etcdctl
   - restart etcd to cause apisix reconnect
   
   
   I haven't actually tried it yet, but I guess it should be able to reproduce stably


----------------------------------------------------------------
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.

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



[GitHub] [apisix] ShiningRush edited a comment on pull request #2687: fix(etcd): handle etcd compaction

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on pull request #2687:
URL: https://github.com/apache/apisix/pull/2687#issuecomment-724605995


   it should reproduce by follow steps:
   - update the some key
   - manually compact etcd by etcdctl
   - restart etcd to cause apisix reconnect
   
   
   I haven't actually tried it yet, but I guess it should be able to reproduce stably


----------------------------------------------------------------
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.

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