spacewander commented on code in PR #6934:
URL: https://github.com/apache/apisix/pull/6934#discussion_r860525004


##########
apisix/balancer.lua:
##########
@@ -50,12 +50,17 @@ local function transform_node(new_nodes, node)
         new_nodes._priority_index = {}
     end
 
-    if not new_nodes[node.priority] then
-        new_nodes[node.priority] = {}
-        core.table.insert(new_nodes._priority_index, node.priority)
+    local node_priority = 0   -- if nodes don't specify priority using default
+    if node.priority then

Review Comment:
   Is it possible to call 
https://github.com/apache/apisix/blob/353e10b60e3604f80bae173a07c3c570f38ae367/apisix/upstream.lua#L179?
   
   We already have a fixing logic in 
https://github.com/apache/apisix/blob/353e10b60e3604f80bae173a07c3c570f38ae367/apisix/upstream.lua#L219.
   
   It will be terrible to fill a default value in three places.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to