Skip to content

Updating `last_activity_at` and `pushes_since_gc` on every push can block the database

Customer issue: https://gitlab.zendesk.com/agent/tickets/19704

When there are many Sidekiq tasks backlogged, each push event causes two columns to be updated:

  • last_activity_at
  • pushes_since_gc

This can hammer the database to the point where the rate at which these locks get resolved is slower than the rate at which new locks are inserted. Part of the problem is that the index to last_activity_at also gets updated each time this column changes.

The temporary solution is to disable updates to these columns.

We need a more performant solution here. For example, we may only want to update these columns every 60 seconds for each project.

/cc: @jnijhof, @dzaporozhets, @dblessing