Broken master with MySQL: ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb
Job #202151987 failed for 2164d977:
1) Gitlab::BackgroundMigration::PruneOrphanedGeoEvents PrunableEvent .delete_batch_of_orphans! vacuums table after deleting rows
Failure/Error: subject.delete_batch_of_orphans!
ActiveRecord::StatementInvalid:
Mysql2::Error: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery': DELETE FROM `geo_repository_updated_events` WHERE `geo_repository_updated_events`.`id` IN (SELECT `geo_repository_updated_events`.`id` FROM `geo_repository_updated_events` WHERE (NOT EXISTS ( SELECT 1 FROM geo_event_log WHERE geo_event_log.repository_updated_event_id = geo_repository_updated_events.id )) LIMIT 50000)
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:42:in `delete_batch_of_orphans!'
# ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:38:in `block (4 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
# ./config/initializers/connection_fix.rb:20:in `execute'
2) Gitlab::BackgroundMigration::PruneOrphanedGeoEvents#perform takes the first table if no table is specified
Failure/Error: subject.perform
ActiveRecord::StatementInvalid:
Mysql2::Error: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery': DELETE FROM `geo_repository_created_events` WHERE `geo_repository_created_events`.`id` IN (SELECT `geo_repository_created_events`.`id` FROM `geo_repository_created_events` WHERE (NOT EXISTS ( SELECT 1 FROM geo_event_log WHERE geo_event_log.repository_created_event_id = geo_repository_created_events.id )) LIMIT 50000)
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:42:in `delete_batch_of_orphans!'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:67:in `prune_orphaned_rows'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:59:in `perform'
# ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:54:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
# ./config/initializers/connection_fix.rb:20:in `execute'
3) Gitlab::BackgroundMigration::PruneOrphanedGeoEvents#perform deletes orphans
Failure/Error: expect { background_migration.perform(event_table_name) }.to change { Geo::RepositoryUpdatedEvent.count }.by(-1)
ActiveRecord::StatementInvalid:
Mysql2::Error: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery': DELETE FROM `geo_repository_updated_events` WHERE `geo_repository_updated_events`.`id` IN (SELECT `geo_repository_updated_events`.`id` FROM `geo_repository_updated_events` WHERE (NOT EXISTS ( SELECT 1 FROM geo_event_log WHERE geo_event_log.repository_updated_event_id = geo_repository_updated_events.id )) LIMIT 50000)
# ./config/initializers/connection_fix.rb:20:in `execute'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:42:in `delete_batch_of_orphans!'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:67:in `prune_orphaned_rows'
# ./ee/lib/gitlab/background_migration/prune_orphaned_geo_events.rb:59:in `perform'
# ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:58:in `block (4 levels) in <top (required)>'
# ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:58:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Mysql2::Error:
# This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
# ./config/initializers/connection_fix.rb:20:in `execute'
Finished in 9 minutes 25 seconds (files took 15.3 seconds to load)
1582 examples, 3 failures, 7 pending
Failed examples:
rspec ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:30 # Gitlab::BackgroundMigration::PruneOrphanedGeoEvents PrunableEvent .delete_batch_of_orphans! vacuums table after deleting rows
rspec ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:51 # Gitlab::BackgroundMigration::PruneOrphanedGeoEvents#perform takes the first table if no table is specified
rspec ./ee/spec/lib/gitlab/background_migration/prune_orphaned_geo_events_spec.rb:57 # Gitlab::BackgroundMigration::PruneOrphanedGeoEvents#perform deletes orphans
! Generating reports is disabled. To enable it, please set the `FLAKY_RSPEC_GENERATE_REPORT=1` !
I added geo: false
in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/11510 because :geo
is used in EE::MigrationsHelpers
to choose which database to use
```def with_db_config(&block)
if geo_migration?
::Gitlab::Geo::DatabaseTasks.with_geo_db { yield }
else
yield
end
end```
and this migration shouldn't be run on the Geo database but that also means this file is run against MySQL so it also needs the :postgresql
metadata.