Remove rake task to refresh the foreign tables

Since Gitlab 13.2 Geo does not rely on the
Foreign Data Wrapper to replicate data.
parent ab38e6c7
......@@ -50,18 +50,6 @@ namespace :geo do
Gitlab::Geo::DatabaseTasks.load_seed
end
desc 'GitLab | Geo | DB | Refresh Foreign Tables definition in Geo Secondary node'
task refresh_foreign_tables: [:environment] do
if Gitlab::Geo::GeoTasks.foreign_server_configured?
print "\nRefreshing foreign tables for FDW: #{Gitlab::Geo::Fdw::FOREIGN_SCHEMA} ... "
Gitlab::Geo::GeoTasks.refresh_foreign_tables!
puts 'Done!'
else
puts "Error: Cannot refresh foreign tables, there is no foreign server configured."
exit 1
end
end
# IMPORTANT: This task won't dump the schema if ActiveRecord::Base.dump_schema_after_migration is set to false
task _dump: [:environment] do
if Gitlab::Geo::DatabaseTasks.dump_schema_after_migration?
......
......@@ -29,8 +29,6 @@ RSpec.describe 'geo rake tasks', :geo do
it 'Gitlab::Geo::GeoTasks responds to all methods used in Geo rake tasks' do
%i[
foreign_server_configured?
refresh_foreign_tables!
set_primary_geo_node
update_primary_geo_node_url
].each do |method|
......@@ -115,15 +113,6 @@ RSpec.describe 'geo rake tasks', :geo do
end
end
describe 'geo:db:refresh_foreign_tables' do
it 'refreshes foreign tables definition on secondary node' do
allow(Gitlab::Geo::GeoTasks).to receive(:foreign_server_configured?).and_return(true)
expect(Gitlab::Geo::GeoTasks).to receive(:refresh_foreign_tables!)
run_rake_task('geo:db:refresh_foreign_tables')
end
end
describe 'geo:db:_dump' do
it 'dumps the schema' do
allow(Gitlab::Geo::DatabaseTasks).to receive(:dump_schema_after_migration?).and_return(true)
......@@ -231,15 +220,6 @@ RSpec.describe 'geo rake tasks', :geo do
end
end
describe 'geo:db:test:refresh_foreign_tables' do
it 'refreshes foreign tables definitions in test environment' do
allow(ActiveRecord::Tasks::DatabaseTasks).to receive(:env)
expect(Rake::Task['geo:db:refresh_foreign_tables']).to receive(:invoke)
run_rake_task('geo:db:test:refresh_foreign_tables')
end
end
describe 'geo:set_primary_node' do
before do
stub_config_setting(url: 'https://example.com:1234/relative_part')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment