storj/satellite/accounting
Isaac Hess d5d0c442ac satellite/accounting/rollup: Use lastRollup as zero-value
In satellite/accounting/rollup Service.RollupStorage we have a few
potential error scenarios that return time.Now(). Especially in the case
where we exit early because we have received 0 tallies since the *last*
rollup, this creates a potential race condition.

Between the time we call GetTalliesSince and realize it is empty, it's
possible a tally was inserted in that interval. As currently written we
are returning a latestTally time that excludes that tally.

We are currently protected because in Service.Rollup we don't save the
rollup unless we have populated the rollupStats. However, this change is
more correct and future-proof, because Service.RollupStorage should
always return a correct latestTally time, which in case of errors and
empty tallies, is the last successful tally.

Change-Id: I2521a2cc9802c8f06e512dde4422803a272e2a0a
2019-12-18 21:33:33 +00:00
..
live private: rename internal to private (#3573) 2019-11-14 21:46:15 +02:00
rollup satellite/accounting/rollup: Use lastRollup as zero-value 2019-12-18 21:33:33 +00:00
tally private: rename internal to private (#3573) 2019-11-14 21:46:15 +02:00
bucketstats.go satellite/accounting: refactor code and remove unused fields (#3178) 2019-10-04 22:09:52 +03:00
bucketusage.go satellite/satellitedb: console tables archview comments updated (#3465) 2019-11-04 16:37:39 +02:00
common.go rename all the things (#2531) 2019-07-28 08:55:36 +03:00
db_test.go satellite/accounting: fix project limits migration (#3717) 2019-12-10 18:12:49 +02:00
db.go satellite/accounting: fix project limits migration (#3717) 2019-12-10 18:12:49 +02:00
projectusage_test.go satellite: adds and enables cockroachdb compatibility for tests 2019-12-16 22:29:25 +00:00
projectusage.go satellite/console: project usage limits api (#3702) 2019-12-12 14:58:15 +02:00