Re: [compute-pressure] Fix penalty algorithm (#230)

Sorry for the unclear explanation, here is maybe an example that could help understand.

let say you are at 1 change away from getting a penalty... last state was Nominal.

A new state arrives. Fair. You are reaching the threshold of change 
 you do not pass the rate obfuscation test, let s go through the steps.

- you set AfterPenaltyRecord = Fair
- you schedule the call for QueueAfterPenalty.
- Set the change count to 0.
- continue

Fine... up to now.

Then comes another change "Fair", from the collector... what happens:

you pass the rate test,
you pass the has change in data test (because you didnt update the LastRecordMap (since it is done just before the callback)
You pass the RateObsfuscation test, because you have set the change count to 0 previously.

So you end up to QueuePressureRecord, and you are publishing the "fair" state to the user. While you should be in penalty. (you are bypassing the penalty) ,
Then because you reached QueuePressureRecord, you will then update LastRecordMap, and everything falls into place again... though at next state change you will again face the same issue.

So setting change count to 0 when penalty is applied is solving an issue, but creating another.
How to solve it, is to check before rate obfuscation test, if we are performing a penalty.
If yes, then we save the new record in AfterPenaltyRecordMap and continue.

-- 
GitHub Notification of comment by arskama
Please view or discuss this issue at https://github.com/w3c/compute-pressure/pull/230#issuecomment-1696149334 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 28 August 2023 18:28:15 UTC