tzssangglass commented on a change in pull request #3758:
URL: https://github.com/apache/apisix/pull/3758#discussion_r592063112



##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -309,7 +314,8 @@ function _M.access(conf, ctx)
         return
     end
 
-    local rr_up, err = lrucache(weighted_upstreams, nil, new_rr_obj, 
weighted_upstreams)
+    local rr_up, err = lrucache(weighted_upstreams, nil, new_rr_obj, 
weighted_upstreams,

Review comment:
       I tried it and it still doesn't work, because this plugin still need to 
control the weight by modifying the `upstream_id` in the route,  even if 
`core.lrucache.plugin_ctx` is used, since `route_upstream_id` is in the key and 
`route_upstream_id` will be overwritten by the `plugin_upstream_id`, it will 
result in two keys and inaccurate data obtained.
   
   use `weighted_upstreams` as key because `weighted_upstreams` do not change.




----------------------------------------------------------------
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:
[email protected]


Reply via email to