Geo: Improve performance of automatic verification in SSF

After #301244 (closed) is closed, we have an opportunity to improve performance on Geo secondaries.

And bonus: it reduces ~"technical debt".

Proposal

Since no registry will ever be both synced and verification_failed, we can simplify queries in Geo secondary sites and simplify indexes, and therefore improve performance.

  • Remove verification_failed (only scope to verification_pending) from VerifiableRegistry.needs_verification_relation to simplify the query
  • Return none from VerifiableRegistry.verification_failed_batch_relation to stop trying to fetch these for retry. It'd always return empty anyway.
  • Return 0 or consider removing VerifiableReplicator#verification_failed_count since it'd always be 0 anyway.
  • Modify indexes like package_file_registry_needs_verification and the corresponding part in the framework doc
  • Remove indexes like package_file_registry_failed_verification and the corresponding part in the framework doc
  • Migrate existing data of things which are synced and verification_failed, so they get resynced.

Follow up tech debt questions

  • #{replicable_name_plural}_verification_failed_count attributes on GeoNodeStatus will always be 0. Should we remove these?
  • Is verification_retry_at needed on registry tables?
  • Is VerificationState/VerifiableRegistry is the right abstraction? Maybe we should have PrimaryVerificationState/VerifiableRegistry/some module shared between the two?
Edited by Michael Kozono