Glitch-Shrike/db
Claire 526332c545
Fix account deletion sometimes failing because of optimistic locks (#16317)
* Fix account deletion sometimes failing because of optimistic locks

In some rare occasions[1], deleting accounts would fail with a
`StaleObjectError` exception.

Indeed, account deletion manually sets the `AccountStat` values without
handling cases where the optimistic locking on `AccountStat` would fail.

To my knowledge, with the rewrite of account counters in #15913, the
`DeleteAccountService` is now the only place that changes the counters in
a way that is not atomic.

Since in this specific case, we do not care about the previous values of the
account counters, it appears we don't need locking at all for this table
anymore.

[1]: https://discourse.joinmastodon.org/t/account-cant-be-deleted/3602

* Bump MAX_SUPPORTED_VERSION in maintenance script
2021-06-02 17:41:25 +02:00
..
migrate Do not populate AccountSummaries and FollowRecommendation views on migration (#16173) 2021-05-07 18:14:29 +02:00
post_migrate Fix account deletion sometimes failing because of optimistic locks (#16317) 2021-06-02 17:41:25 +02:00
views Improve performance of follow recommendation scheduler (#16159) 2021-05-05 22:04:52 +02:00
schema.rb Fix account deletion sometimes failing because of optimistic locks (#16317) 2021-06-02 17:41:25 +02:00
seeds.rb Change unconfirmed user login behaviour (#11375) 2019-07-22 10:48:50 +02:00