Hello,
I have upgraded one of our instances following 13.12.15 → 14.0.12 → 14.1.8 and it appears that one of the database background migrations is stuck on pending.
I wondered if anyone else has had an issue with this migration? I have left it for almost 48 hours and it is still sat at pending.
gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending[0].pretty_inspect'
#<Gitlab::Database::BackgroundMigrationJob:0x00007f574e6185a8
id: 3,
created_at: Thu, 28 Apr 2022 22:08:16.086878000 UTC +00:00,
updated_at: Thu, 28 Apr 2022 22:08:16.086878000 UTC +00:00,
status: "pending",
class_name: "BackfillDraftStatusOnMergeRequests",
arguments: [185, 219]>
I have tried to re-run as per Upgrading GitLab | GitLab[Restart Pending Migration]
--------------------------------------------------------------------------------
Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
GitLab: 14.1.8 (9d8642e1d6b) FOSS
GitLab Shell: 13.19.1
PostgreSQL: 12.7
--------------------------------------------------------------------------------
Loading production environment (Rails 6.1.3.2)
irb(main):001:0> result = Gitlab::BackgroundMigration.perform(job.class_name, job.arguments)
puts "Result: #{result}"
irb(main):001:1* Gitlab::Database::BackgroundMigrationJob.pending.find_each do |job|
irb(main):002:1* puts "Running pending job '#{job.class_name}' with arguments #{job.arguments}"
irb(main):003:1* result = Gitlab::BackgroundMigration.perform(job.class_name, job.arguments)
irb(main):004:1* puts "Result: #{result}"
irb(main):005:0> end
Running pending job 'BackfillDraftStatusOnMergeRequests' with arguments [185, 219]
Result:
=> nil
irb(main):006:0>
and gitlab-rake db:migrate
but it didn’t appear to do anything.
The migration shows as up
up 20210609202501 Schedule backfill draft status on merge request
I can set it as completed but unsure if it has actually ran, and for some reason has not updated in the database or not.
Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded('BackfillDraftStatusOnMergeRequests', [185,219])