• Marius Bobin's avatar
    Add helper to check for wraparound vacuum processes · 4944551f
    Marius Bobin authored and Diogo Frazão's avatar Diogo Frazão committed
    Autovacuum to prevent wraparound on ci_builds table takes around
    10 hours in production and it can block migrations that try to
    lock the table at the same time. This helper can be used to fail
    the migration early with a more helpful error message:
    
    ```ruby
    class RemoveCiBuildsPartitionIdDefault < Gitlab::Database::Migration[2.1]
      enable_lock_retries!
    
      def up
        fail_if_wraparound_in_progress!(:ci_builds)
        change_column_default :ci_builds, :partition_id, from: 100, to: nil
      end
    end
    ```
    4944551f