grafana/pkg
Sofia Papagiannaki 7b70e7db2d
AuthProxy: Optimistic lock pattern for remote cache Set (#17485)
* Implementation of optimistic lock pattern

Try to insert the remote cache key and handle integrity error

* Remove transaction

Integrity error inside a transaction results in deadlock

* Remove check for existing remote cache key

Is no longer needed since integrity constrain violations are handled

* Add check for integrity constrain violation

Do not update the row if the insert statement fails
for other than an integrity constrain violation

* Handle failing inserts because of deadlocks

If the insert statement fails because of a deadlock
try to update the row

* Add utility function for returning SQL error code

Useful for debugging

* Add logging for failing expired cache key deletion

Do not shallow it completely

* Revert "Add utility function for returning SQL error code"

This reverts commit 8e0b82c79633e7d8bc350823cbbab2ac7a58c0a5.

* Better log for failing deletion of expired cache key

* Add some comments

* Remove check for existing cache key

Attempt to insert the key without checking if it's already there
and handle the error situations

* Do not propagate deadlocks created during update

Most probably somebody else is trying to insert/update
the key at the same time so it is safe enough to ignore it
2019-06-13 15:36:09 +02:00
..
api codestyle: moves cache to infra (#17519) 2019-06-13 10:55:38 +02:00
bus Codestyle: Fix govet issues (#17178) 2019-06-04 22:00:05 +02:00
cmd Fix so that correct cache is provided to di registry (#17566) 2019-06-13 12:15:52 +02:00
components gtime: some code style refactoring (#17369) 2019-06-10 07:38:31 +02:00
events feat(signup): progress on new sign up and email verification flow, #2353 2015-08-28 15:14:24 +02:00
extensions Enterprise: remove gofakeit dep (#17344) 2019-05-29 15:55:51 +03:00
infra AuthProxy: Optimistic lock pattern for remote cache Set (#17485) 2019-06-13 15:36:09 +02:00
login LDAP: consistently name the LDAP entities (#17203) 2019-05-22 15:30:03 +03:00
middleware middleware: add security related HTTP(S) response headers (#17522) 2019-06-12 13:15:50 +02:00
models metrics: expose stats about roles as metrics (#17469) 2019-06-06 16:39:35 +02:00
plugins Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263) 2019-06-03 14:54:32 +02:00
registry add functionality to override service in registry 2018-10-30 13:37:30 +01:00
services AuthProxy: Optimistic lock pattern for remote cache Set (#17485) 2019-06-13 15:36:09 +02:00
setting middleware: add security related HTTP(S) response headers (#17522) 2019-06-12 13:15:50 +02:00
tsdb Prometheus: Preallocate data for Prometheus backend response parsing (#17490) 2019-06-10 08:12:46 +02:00
util CLI: Add command to migrate all datasources to use encrypted password fields (#17118) 2019-05-27 10:47:21 +02:00