Database timeout in pages migration task
From https://gitlab.com/gitlab-com/gl-infra/production/-/issues/3252#note_519858615
ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:72:in `block in read_using_load_balancer'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/load_balancer.rb:34:in `read'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `read_using_load_balancer'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:44:in `select_all'
/opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/each_batch.rb:80:in `block in each_batch'
/opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/each_batch.rb:68:in `step'
/opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/each_batch.rb:68:in `each_batch'
/opt/gitlab/embedded/service/gitlab-rails/app/services/pages/migrate_from_legacy_storage_service.rb:21:in `execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/pages.rake:14:in `block (3 levels) in <top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Caused by:
PG::QueryCanceled: ERROR: canceling statement due to statement timeout
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:72:in `block in read_using_load_balancer'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/load_balancer.rb:34:in `read'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `read_using_load_balancer'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:44:in `select_all'
/opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/each_batch.rb:80:in `block in each_batch'
/opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/each_batch.rb:68:in `step'
/opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/each_batch.rb:68:in `each_batch'
/opt/gitlab/embedded/service/gitlab-rails/app/services/pages/migrate_from_legacy_storage_service.rb:21:in `execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/pages.rake:14:in `block (3 levels) in <top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => gitlab:pages:migrate_legacy_storage
(See full trace by running task with --trace)