nic-6443 commented on PR #14239:
URL: https://github.com/apache/apisix/pull/14239#issuecomment-7038425270

   Thanks again. Status of the three:
   
   2. Fixed in e888705bb. The local fixed-window limiter now keeps the consumed 
amount on a rejection as an internal `consumed` field next to `count`, read 
back from its shared dict since `resty.limit.count` only returns `"rejected"`. 
The delayed sync uses it for the rejected remaining; `$rate_limiting_info` 
still serializes only `count`, so its output doesn't change. 
`limit-count-conf-update.t` TEST 9 covers a fallback rejection followed by a 
count increase (it gave `remaining 2` before, `remaining 1` now).
   
   1. Agreed, with the hash gone the action counters follow the rule position. 
Before, swapping two actions with different configurations gave each a new 
hash, so the counters effectively reset. Fixing this means changing how 
`workflow` assigns `_vid`, and that file is also being changed in #14238, so 
I'll follow up on that once we've settled what the action identity should be 
keyed on.
   
   3. Right, `cost_strategy` and `score_factor` change the unit of what's 
stored, not just the threshold. Whether the counter should restart on a 
cost-model change (cost model in the identity) or keep the raw consumption and 
only cost new queries with the new model is a behaviour choice; I'll come back 
with the decision plus a test and docs for it.
   
   Docs: the three plugin pages now also say that during a rolling upgrade old 
and new nodes use different keys and don't share consumption, so a Redis-backed 
limit is split between the versions until every node is upgraded.
   


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