# Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now.
relation=
ifGitlab::Geo.fdw?&&!selective_sync
fdw_find_unsynced_projects
else
legacy_find_unsynced_projects
end
relation.limit(batch_size)
end
protected
defselective_sync
current_node.restricted_project_ids
end
#
# FDW accessors
#
deffdw_find_unsynced_projects
fdw_table=Geo::Fdw::Project.table_name
Geo::Fdw::Project.joins("LEFT OUTER JOIN project_registry ON project_registry.project_id = #{fdw_table}.id").where('project_registry.project_id IS NULL')