Geo - Respect shard restriction while loading new resources to verify on the secondary
Summary
While investigating https://gitlab.com/gitlab-org/gitlab-ee/issues/7109 I found a bug in the Geo::RepositoryVerification::Secondary::ShardWorker#load_pending_resources method. It does not apply the shard restriction while loading pending resources.
What is the current bug behavior?
Since we spawn a worker per shard, a project can be scheduled multiple times to be verified.
What is the expected correct behavior?
Geo::RepositoryVerification::Secondary::ShardWorker
should only schedule projects store on the shard associated with it.
Possible fixes
Apply the shard restriction while retrieving projects in the Geo::RepositoryVerification::Secondary::ShardWorker#load_pending_resources
method.
/cc @rnienaber