High number of statement timeouts in GroupDestroyWorker due to SiteStatistics
https://sentry.gitlap.com/gitlab/gitlabcom/issues/479318/
PG::QueryCanceled: ERROR: canceling statement due to statement timeout
CONTEXT: while rechecking updated tuple (5,8) in relation "site_statistics"
peek/views/pg.rb:17:in `async_exec'
super(*args)
peek/views/pg.rb:17:in `async_exec'
super(*args)
active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
log(sql, name, binds) { @connection.async_exec(sql, []) }
active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
:binds => binds) { yield }
active_support/notifications/instrumenter.rb:20:in `instrument'
yield payload
...
(106 additional frame(s) were not displayed)
ActiveRecord::StatementInvalid: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
CONTEXT: while rechecking updated tuple (5,8) in relation "site_statistics"
: UPDATE "site_statistics" SET "wikis_count" = "wikis_count"-1 WHERE "wikis_count" > 0
PG::QueryCanceled: ERROR: canceling statement due to statement timeout
CONTEXT: while rechecking updated tuple (5,8) in relation "site_statistics"
: UPDATE "site_statistics" SET "wikis_count" = "wikis_count"-1 WHERE "wikis_count" > 0
Decisions
-
Remove I/O related work from GroupDestroyWorker transaction. -
Instrument time it takes to finish the transaction
Edited by Gabriel Mazetto