Commit Graph

6 Commits

Author SHA1 Message Date
Mathias Fredriksson 3adcccb618
fix(coderd/database): reduce db load via dbpurge advisory locking (#13021) 2024-04-22 11:10:32 +00:00
Mathias Fredriksson 12e6fbf11e
feat(coderd/database): add `dbrollup` service to rollup insights (#12665)
Add `dbrollup` service that runs the `UpsertTemplateUsageStats` query
every 5 minutes, on the minute. This allows us to have fairly real-time
insights data when viewing "today".
2024-03-22 18:42:43 +02:00
Dean Sheather bedd2c5922
fix: avoid race between replicas on start (#12344)
DERP mesh key setup would do a SELECT and then an INSERT on failure, without a lock. During some testing with multiple replicas, I managed to cause a replica to crash due to them initializing simultaneously.

Fixes:

Encountered an error running "coder server"
create coder API: insert mesh key: pq: duplicate key value violates unique constraint "site_configs_key_key"

Co-authored-by: Cian Johnston <cian@coder.com>
2024-02-28 16:14:11 +00:00
Dean Sheather 98a5ae7f48
feat: add provisioner job hang detector (#7927) 2023-06-25 13:17:00 +00:00
Kyle Carberry bbb0fab1de
chore: merge database gen scripts (#8073)
* chore: merge database gen scripts

* Fix type params gen

* Merge enum into dbgen
2023-06-20 16:24:33 +00:00
Dean Sheather 1bdd2abed7
feat: use JWT ticket to avoid DB queries on apps (#6148)
Issue a JWT ticket on the first request with a short expiry that
contains details about which workspace/agent/app combo the ticket is
valid for.
2023-03-07 19:38:11 +00:00