uninitialized constant Gitlab::BackgroundMigration::PopulateTopicsTotalProjectsCountCache (NameError)
We have upgraded Gitlab from v16.10.1 to v16.11.2
Upgradation was successful.
We ran below commands to confirm whether background migration was completed or not.
gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
Output ==> 0
gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'
Output ==> 0
gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.with_status(:failed).count'
Output ==> 0
gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigrationJob.pending.count'
Output ==> 2
Then we ran below command from gitlab rails console
gitlab-rails console
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
it throw below error
Running pending job 'PopulateTopicsTotalProjectsCountCache' with arguments [1, 12]
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/job_coordinator.rb:149:in `migration_class_for': uninitialized constant Gitlab::BackgroundMigration::PopulateTopicsTotalProjectsCountCache (NameError)
Gitlab::BackgroundMigration.const_get(class_name, false)
^^^^^^^^^^
Did you mean? Gitlab::BackgroundMigration::PopulateApprovalProjectRulesWithSecurityOrchestration
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/job_coordinator.rb:139:in `migration_instance_for'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/job_coordinator.rb:104:in `block in perform'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/shared_model.rb:34:in `using_connection'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/job_coordinator.rb:55:in `with_shared_connection'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/job_coordinator.rb:103:in `perform'
from /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration.rb:41:in `perform'
from (irb):3:in `block in <top (required)>'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:71:in `each'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:71:in `block in find_each'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:138:in `block in find_in_batches'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:245:in `block in in_batches'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:229:in `loop'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:229:in `in_batches'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:137:in `find_in_batches'
from /opt/gitlab/embedded/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.1/lib/active_record/relation/batches.rb:70:in `find_each'
from (irb):1:in `<main>'
Output from UI Admin > Monitoring > Background Migrations
Queued - 0
Finalizing - 0
Failed - 0
Finished - 168
Output of PG query for batched background migration
gitlabhq_production=# SELECT id, job_class_name, table_name, column_name, job_arguments FROM batched_background_migrations WHERE status NOT IN(3, 6);
id | job_class_name | table_name | column_name | job_arguments
----+----------------+------------+-------------+---------------
(0 rows)
So not getting exactly whether it is a bug or not.
Could you please check and confirm.
Thank You.