Rename `Geo::RegistryFinder#fdw?` to `use_legacy_queries?`

parent 54b26296
...@@ -2,10 +2,10 @@ module Geo ...@@ -2,10 +2,10 @@ module Geo
class AttachmentRegistryFinder < RegistryFinder class AttachmentRegistryFinder < RegistryFinder
def find_synced_attachments def find_synced_attachments
relation = relation =
if fdw? if use_legacy_queries?
fdw_find_synced_attachments
else
legacy_find_synced_attachments legacy_find_synced_attachments
else
fdw_find_synced_attachments
end end
relation relation
...@@ -13,10 +13,10 @@ module Geo ...@@ -13,10 +13,10 @@ module Geo
def find_failed_attachments def find_failed_attachments
relation = relation =
if fdw? if use_legacy_queries?
fdw_find_failed_attachments
else
legacy_find_failed_attachments legacy_find_failed_attachments
else
fdw_find_failed_attachments
end end
relation relation
......
...@@ -22,10 +22,10 @@ module Geo ...@@ -22,10 +22,10 @@ module Geo
# Selective project replication adds a wrinkle to FDW queries, so # Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now. # we fallback to the legacy version for now.
relation = relation =
if fdw? if use_legacy_queries?
fdw_find_nonreplicated_lfs_objects
else
legacy_find_nonreplicated_lfs_objects(except_registry_ids: except_registry_ids) legacy_find_nonreplicated_lfs_objects(except_registry_ids: except_registry_ids)
else
fdw_find_nonreplicated_lfs_objects
end end
relation relation
...@@ -48,10 +48,10 @@ module Geo ...@@ -48,10 +48,10 @@ module Geo
# Selective project replication adds a wrinkle to FDW queries, so # Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now. # we fallback to the legacy version for now.
relation = relation =
if fdw? if use_legacy_queries?
fdw_find_nonreplicated_uploads
else
legacy_find_nonreplicated_uploads(except_registry_ids: except_registry_ids) legacy_find_nonreplicated_uploads(except_registry_ids: except_registry_ids)
else
fdw_find_nonreplicated_uploads
end end
relation relation
......
...@@ -28,10 +28,10 @@ module Geo ...@@ -28,10 +28,10 @@ module Geo
def find_unsynced_projects(batch_size:) def find_unsynced_projects(batch_size:)
relation = relation =
if fdw? if use_legacy_queries?
fdw_find_unsynced_projects
else
legacy_find_unsynced_projects legacy_find_unsynced_projects
else
fdw_find_unsynced_projects
end end
relation.limit(batch_size) relation.limit(batch_size)
...@@ -39,10 +39,10 @@ module Geo ...@@ -39,10 +39,10 @@ module Geo
def find_projects_updated_recently(batch_size:) def find_projects_updated_recently(batch_size:)
relation = relation =
if fdw? if use_legacy_queries?
fdw_find_projects_updated_recently
else
legacy_find_projects_updated_recently legacy_find_projects_updated_recently
else
fdw_find_projects_updated_recently
end end
relation.limit(batch_size) relation.limit(batch_size)
......
...@@ -10,10 +10,10 @@ module Geo ...@@ -10,10 +10,10 @@ module Geo
protected protected
def fdw? def use_legacy_queries?
# Selective project replication adds a wrinkle to FDW # Selective project replication adds a wrinkle to FDW
# queries, so we fallback to the legacy version for now. # queries, so we fallback to the legacy version for now.
Gitlab::Geo.fdw? && !selective_sync? !Gitlab::Geo.fdw? || selective_sync?
end end
end end
end end
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