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 <zchao1...@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:
us...@infra.apache.org


Reply via email to