AlinsRan commented on PR #13666:
URL: https://github.com/apache/apisix/pull/13666#issuecomment-4898959838

   Follow-up after self-review:
   
   - Clamped the persisted count at zero. On retry exhaustion `balancer.lua` 
releases the last picked server twice (once on retry entry, once in the log 
phase); without the clamp that drove the persisted count negative and — unlike 
the old per-version heap — it survived rebuilds and over-preferred the node. 
(2nd commit)
   - Added a drain test covering the decrement path.
   
   Known scope limit worth calling out: the single-node fast path in 
`pick_server` (`balancer.lua:251`) returns the node without going through the 
picker, so connections during a single-node phase aren't counted. This fix 
covers scaling between multi-node states (the 2→3 case in #12217); it does not 
carry over pre-scale connections on a 1→2 transition. Handling that would mean 
removing the single-node fast path for all least_conn upstreams, which seems a 
poor tradeoff — happy to revisit if reviewers disagree.


-- 
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