Add RuboCop cop to disallow update_column_in_batches on large tables

9.3.0 showed that update_column_in_batches doesn't work very well on very large tables (e.g. ci_builds which is about 50GB). To prevent running into problems we should add a RuboCop rule that disallows the use of update_column_in_batches on the following tables:

  • ci_builds
  • ci_pipelines
  • merge_requests
  • issues
  • notes
  • events
  • users: this table isn't that large, but past experiences have shown that updating all rows in this table can lead to downtime

For these tables one instead will have to use background migrations, roughly using the following steps:

  1. Set the default for new rows
  2. Schedule background jobs to update existing rows

This however is something we will have to document/test/etc separately.

I have labelled this ~AP1 because it's not unlikely somebody will introduce a migration for these mentioned tables for the next release, possibly leading to an outage again.

Edited Jun 23, 2017 by Yorick Peterse
Assignee Loading
Time tracking Loading