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 toverification_pending) fromVerifiableRegistry.needs_verification_relationto simplify the query -
Return nonefromVerifiableRegistry.verification_failed_batch_relationto stop trying to fetch these for retry. It'd always return empty anyway. -
Return 0 or consider removing VerifiableReplicator#verification_failed_countsince it'd always be 0 anyway. -
Modify indexes like package_file_registry_needs_verificationand the corresponding part in the framework doc -
Remove indexes like package_file_registry_failed_verificationand the corresponding part in the framework doc -
Migrate existing data of things which are syncedandverification_failed, so they get resynced.
Follow up tech debt questions
-
#{replicable_name_plural}_verification_failed_countattributes onGeoNodeStatuswill always be 0. Should we remove these? -
Is verification_retry_atneeded on registry tables? -
Is VerificationState/VerifiableRegistryis the right abstraction? Maybe we should havePrimaryVerificationState/VerifiableRegistry/some module shared between the two?
Edited by Michael Kozono