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 2021/11/03 12:50:15 UTC

[GitHub] [apisix] tzssangglass opened a new pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams nder each rule cause upstream_key duplicate

tzssangglass opened a new pull request #5414:
URL: https://github.com/apache/apisix/pull/5414


   
   
   Signed-off-by: tzssangglass <tz...@gmail.com>
   
   ### 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. -->
   fix: #5276
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


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

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



[GitHub] [apisix] tzssangglass commented on a change in pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams under each rule cause upstream_key duplicate

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



##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -203,6 +207,14 @@ local function new_rr_obj(weighted_upstreams)
         elseif upstream_obj.upstream then
             -- Add a virtual id field to uniquely identify the upstream key.
             upstream_obj.upstream.vid = i
+            if upstream_obj.upstream.nodes then

Review comment:
       remove it




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

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



[GitHub] [apisix] spacewander merged pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams under each rule cause upstream_key duplicate

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


   


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

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



[GitHub] [apisix] spacewander commented on a change in pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams nder each rule cause upstream_key duplicate

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



##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -203,6 +207,14 @@ local function new_rr_obj(weighted_upstreams)
         elseif upstream_obj.upstream then
             -- Add a virtual id field to uniquely identify the upstream key.
             upstream_obj.upstream.vid = i

Review comment:
       It seems the vid is no longer required?

##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -203,6 +207,14 @@ local function new_rr_obj(weighted_upstreams)
         elseif upstream_obj.upstream then
             -- Add a virtual id field to uniquely identify the upstream key.
             upstream_obj.upstream.vid = i
+            if upstream_obj.upstream.nodes then

Review comment:
       Look like the nodes check here can be skipped?




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

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



[GitHub] [apisix] tzssangglass commented on a change in pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams under each rule cause upstream_key duplicate

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



##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -203,6 +207,14 @@ local function new_rr_obj(weighted_upstreams)
         elseif upstream_obj.upstream then
             -- Add a virtual id field to uniquely identify the upstream key.
             upstream_obj.upstream.vid = i

Review comment:
       may not, here test vid:https://github.com/apache/apisix/blob/4dafab5afa3293b3d72007517246e01da385f8ef/t/plugin/traffic-split3.t#L398-L461




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

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



[GitHub] [apisix] spacewander merged pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams under each rule cause upstream_key duplicate

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


   


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

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



[GitHub] [apisix] spacewander merged pull request #5414: fix(traffix-split): multiple rules with multiple weighted_upstreams under each rule cause upstream_key duplicate

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


   


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

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