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/09/11 06:47:04 UTC

[GitHub] [apisix] tokers opened a new pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

tokers opened a new pull request #2216:
URL: https://github.com/apache/apisix/pull/2216


   #1750 # 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. -->
   
   There is a potential concurrency problem in all admin PATCH APIs when
   two patch requests come in simultaneously, in such case, the patched
   result of the first applied request will be overridden, also the
   probability is tidy, but from the perspective of software's robust,
   that's not what we wanna to see.
   
   In this commit, we use the optimistic locking to avoid this problem, for
   the example aforementioned, the second PATCH request will failure, and
   it's up to the user to retry this PATCH request again.
   
   The optimistic locking mechanism in ETCD v2 APIs is showed by arg
   `prevIndex`.
   
   Signed-off-by: tokers <zc...@gmail.com>
   
   ### Pre-submission checklist:
   
   * [x ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] 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] tokers commented on pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

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


   @membphis @moonming This PR should be adjusted to the ETCD v3 data structure, So i mark it as work in progress.
   


----------------------------------------------------------------
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] tokers commented on pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

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


   @membphis @moonming Please help me to retry the checks 😂, it's weird that this failure only in linux_tengine.


----------------------------------------------------------------
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] moonming merged pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

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


   


----------------------------------------------------------------
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] tokers commented on pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

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


   @membphis Could you review this PR once again? The adjustment was done.


----------------------------------------------------------------
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] tokers commented on pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

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


   @membphis Adjusted.


----------------------------------------------------------------
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] tokers commented on pull request #2216: improve: use optimistic locking to avoid concurrency problem in admin…

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


   @membphis :)


----------------------------------------------------------------
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 pull request #2216: WIP: improve: use optimistic locking to avoid concurrency problem in admin…

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


   @tokers got it, we can merge this PR 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