f626cd1868
Satellite caches the project bandwidth in Redis when it doesn't have it because was not set or the key expired, however, it doesn't perform the check and set if not exists in a transaction. It also uses the increase function which increases the value if it exists otherwise it sets it. This provokes that multiple concurrent request to the same project may increase the total project by multiples of the bandwidth usage registered in the database rather than setting it because they may check if the key exists before any other has executed the increase and then the first one executing it will set the value but the others will increased causing that Redis has a wrong bandwidth usage value which is N magnitude of the real one and making the satellite to deny the downloading if it surpasses the project limit. This commit changes the "update"" project bandwidth usage by an "insert" but using a Redis function that only sets the value if the key doesn't exists for solving the increase issue but also not overriding the value due to may contain updates of other downloading requests which aren't already registered in the DB. Change-Id: I33e2fe462930b2fdb4061fc94002bd3544476f94 |
||
---|---|---|
.. | ||
live | ||
nodetally | ||
projectbwcleanup | ||
rollup | ||
rolluparchive | ||
tally | ||
billing_test.go | ||
bucketstats.go | ||
bucketusage.go | ||
common.go | ||
db_test.go | ||
db.go | ||
projectlimitcache_test.go | ||
projectlimitcache.go | ||
projectusage_test.go | ||
projectusage.go |