nic-6443 opened a new pull request, #12358:
URL: https://github.com/apache/apisix/pull/12358

   ### Description
   
   I introduced a performance optimization in #12258, and after testing, we 
found that the kubernetes performance optimization would invalid after some 
time. 
   The reason is that after watch progress is done in kubernetes service 
discovery for some time, it will re-list all data. At this point, addresses of 
all tables that store service discovery are changed, but the content of nodes 
does not change. This causes `up_conf.nodes` to never reference the `new_nodes` 
table at 
https://github.com/apache/apisix/blob/9e5163c60b74589672b10201355b855098166f4a/apisix/upstream.lua#L305-L317
 because their addresses are different and it goes to the branch where equality 
is determined by value in every downstream requests.
   This branch has significant performance overhead: 
https://github.com/apache/apisix/blob/9e5163c60b74589672b10201355b855098166f4a/apisix/utils/upstream.lua#L50-L61
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
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-unsubscr...@apisix.apache.org

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

Reply via email to