Remove Geo::RegsitryFinder#current_node_fdw method

Since GitLab 13.2 we don't rely on FDW query/models
parent a0adf4a2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Geo module Geo
class ContainerRepositoryRegistryFinder < RegistryFinder class ContainerRepositoryRegistryFinder < RegistryFinder
def count_syncable def count_syncable
current_node_non_fdw.container_repositories.count container_repositories.count
end end
def count_synced def count_synced
...@@ -19,7 +19,7 @@ module Geo ...@@ -19,7 +19,7 @@ module Geo
end end
def find_registry_differences(range) def find_registry_differences(range)
source_ids = current_node_non_fdw.container_repositories.id_in(range).pluck_primary_key source_ids = container_repositories.id_in(range).pluck_primary_key
tracked_ids = Geo::ContainerRepositoryRegistry.pluck_model_ids_in_range(range) tracked_ids = Geo::ContainerRepositoryRegistry.pluck_model_ids_in_range(range)
untracked_ids = source_ids - tracked_ids untracked_ids = source_ids - tracked_ids
...@@ -63,5 +63,11 @@ module Geo ...@@ -63,5 +63,11 @@ module Geo
.limit(batch_size) .limit(batch_size)
end end
# rubocop:enable CodeReuse/ActiveRecord # rubocop:enable CodeReuse/ActiveRecord
private
def container_repositories
current_node.container_repositories
end
end end
end end
...@@ -66,7 +66,7 @@ module Geo ...@@ -66,7 +66,7 @@ module Geo
private private
def designs def designs
current_node_non_fdw.designs current_node.designs
end end
def registries def registries
......
...@@ -151,7 +151,7 @@ module Geo ...@@ -151,7 +151,7 @@ module Geo
end end
def local_storage_only? def local_storage_only?
!current_node(fdw: false)&.sync_object_storage !current_node&.sync_object_storage
end end
end end
end end
...@@ -3,13 +3,17 @@ ...@@ -3,13 +3,17 @@
module Geo module Geo
class LfsObjectRegistryFinder < FileRegistryFinder class LfsObjectRegistryFinder < FileRegistryFinder
def replicables def replicables
lfs_objects = current_node(fdw: false).lfs_objects
local_storage_only? ? lfs_objects.with_files_stored_locally : lfs_objects local_storage_only? ? lfs_objects.with_files_stored_locally : lfs_objects
end end
def syncable def syncable
Geo::LfsObjectRegistry Geo::LfsObjectRegistry
end end
private
def lfs_objects
current_node.lfs_objects
end
end end
end end
...@@ -14,18 +14,8 @@ module Geo ...@@ -14,18 +14,8 @@ module Geo
private private
def current_node(fdw: true) def current_node
fdw ? current_node_fdw : current_node_non_fdw strong_memoize(:current_node) do
end
def current_node_fdw
strong_memoize(:current_node_fdw) do
Geo::Fdw::GeoNode.find(current_node_id) if current_node_id
end
end
def current_node_non_fdw
strong_memoize(:current_node_non_fdw) do
GeoNode.find(current_node_id) if current_node_id GeoNode.find(current_node_id) if current_node_id
end end
end end
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Geo::FileRegistryFinder, :geo do RSpec.describe Geo::FileRegistryFinder, :geo do
include ::EE::GeoHelpers
context 'with abstract methods' do context 'with abstract methods' do
%w[ %w[
replicables replicables
......
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