Hi, first time poster here.
We are running into problems when we are doing upgrade from 14.4.5 to 14.5.3.
Problems arise in gitlab-rake db:migrate phase when it hits this stage:
== 20211012134316 CleanUpMigrateMergeRequestDiffCommitUsers: migrating ========
– 21 MigrateMergeRequestDiffCommitUsers are still pending
Currently we are trying to migrate this with virtual machine that has 256 GB memory so that shouldn’t be an issue.
We checked the size of merge_request_diff_commits table and it’s about 175197110 lines and about 53 GB.
It fails after running about 17-18 hours with following error message:
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UnableToSend: no connection to the server
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in block in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:125:in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:77:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:252:in block in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:251:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in ddl_transaction' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Caused by:
ActiveRecord::StatementInvalid: PG::UnableToSend: no connection to the server
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in block in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:125:in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:77:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:252:in block in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:251:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in ddl_transaction' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Caused by:
PG::UnableToSend: no connection to the server
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in block in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:125:in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:77:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:252:in block in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:251:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in ddl_transaction' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Caused by:
ActiveRecord::StatementInvalid: PG::UnableToSend: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:106:in block in read_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:105:in read_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:54:in
select_all’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:65:in block in each_row_to_migrate' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/pagination/keyset/iterator.rb:25:in
block in each_batch’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/pagination/keyset/iterator.rb:19:in loop' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/pagination/keyset/iterator.rb:19:in
each_batch’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:65:in each_row_to_migrate' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:119:in
get_data_to_update’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:87:in perform' /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb:29:in
block in up’
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb:26:in each' /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb:26:in
up’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in block in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:125:in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:77:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:252:in block in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:251:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in ddl_transaction' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Caused by:
PG::UnableToSend: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:106:in block in read_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:105:in read_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:54:in
select_all’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:65:in block in each_row_to_migrate' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/pagination/keyset/iterator.rb:25:in
block in each_batch’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/pagination/keyset/iterator.rb:19:in loop' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/pagination/keyset/iterator.rb:19:in
each_batch’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:65:in each_row_to_migrate' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:119:in
get_data_to_update’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb:87:in perform' /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb:29:in
block in up’
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb:26:in each' /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb:26:in
up’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in block in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:112:in
block in read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:172:in retry_with_backoff' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:110:in
read_write’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:125:in write_using_load_balancer' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:77:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:252:in block in transaction' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database.rb:251:in
transaction’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migrations/lock_retry_mixin.rb:31:in ddl_transaction' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Tasks: TOP => db:migrate
(See full trace by running task with --trace)