Fix exempt_from_sharding breaking Org mover
These tables need to be fixed
Pending: (Failures listed here are expected and do not affect your suite's status)
1) new tables missing sharding_key does not allow tables with FK references to be permanently exempted
# These tables need to be fixed
Got 4 failures:
1.1) Failure/Error:
expect(fks).to be_empty,
"#{entry.table_name} is exempted from sharding, but has FK references to it\n" \
"#{fks.map(&:constrained_table_name).join("\n")}"
clusters is exempted from sharding, but has FK references to it
metrics_dashboard_annotations
cluster_projects
clusters_integration_prometheus
cluster_groups
# ./spec/lib/gitlab/database/sharding_key_spec.rb:219:in `block (3 levels) in <top (required)>'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `each'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:454:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'
# ./spec/spec_helper.rb:453:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:86:in `with_raw_context'
# ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:260:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
1.2) Failure/Error:
expect(lfks).to be_empty,
"#{entry.table_name} is exempted from sharding, but has LFK references to it\n" \
"#{lfks.map(&:from_table).join("\n")}"
clusters is exempted from sharding, but has LFK references to it
deployment_clusters
# ./spec/lib/gitlab/database/sharding_key_spec.rb:226:in `block (3 levels) in <top (required)>'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `each'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:454:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'
# ./spec/spec_helper.rb:453:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:86:in `with_raw_context'
# ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:260:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
1.3) Failure/Error:
expect(fks).to be_empty,
"#{entry.table_name} is exempted from sharding, but has FK references to it\n" \
"#{fks.map(&:constrained_table_name).join("\n")}"
geo_nodes is exempted from sharding, but has FK references to it
geo_node_namespace_links
geo_repositories_changed_events
# ./spec/lib/gitlab/database/sharding_key_spec.rb:219:in `block (3 levels) in <top (required)>'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `each'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:454:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'
# ./spec/spec_helper.rb:453:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:86:in `with_raw_context'
# ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:260:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
1.4) Failure/Error:
expect(fks).to be_empty,
"#{entry.table_name} is exempted from sharding, but has FK references to it\n" \
"#{fks.map(&:constrained_table_name).join("\n")}"
zoekt_nodes is exempted from sharding, but has FK references to it
zoekt_indices
zoekt_tasks
zoekt_tasks_1
# ./spec/lib/gitlab/database/sharding_key_spec.rb:219:in `block (3 levels) in <top (required)>'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `each'
# ./spec/lib/gitlab/database/sharding_key_spec.rb:211:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:454:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'
# ./spec/spec_helper.rb:453:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:448:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:439:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:435:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:86:in `with_raw_context'
# ./spec/spec_helper.rb:435:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:260:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
Edited by Thong Kuah