gitlab-org--gitlab-foss/db
Yorick Peterse 92b2c74ce1
Refresh project authorizations using a Redis lease
When I proposed using serializable transactions I was hoping we would be
able to refresh data of individual users concurrently. Unfortunately
upon closer inspection it was revealed this was not the case. This could
result in a lot of queries failing due to serialization errors,
overloading the database in the process (given enough workers trying to
update the target table).

To work around this we're now using a Redis lease that is cancelled upon
completion. This ensures we can update the data of different users
concurrently without overloading the database.

The code will try to obtain the lease until it succeeds, waiting at
least 1 second between retries. This is necessary as we may otherwise
end up _not_ updating the data which is not an option.
2016-11-25 13:35:01 +01:00
..
fixtures Refresh project authorizations using a Redis lease 2016-11-25 13:35:01 +01:00
migrate Add a starting date to milestones 2016-11-23 13:41:04 +02:00
post_migrate Fix a badly-performing migration 2016-11-15 17:07:58 +00:00
schema.rb Add a starting date to milestones 2016-11-23 13:41:04 +02:00
seeds.rb init commit 2011-10-09 00:36:38 +03:00