When a primary Package is checksummed, reset verification on secondaries
Problem
When a resource is checksummed on the primary, we need to re-verify on the secondary. By resetting the verification fields on secondaries, the verification jobs will notice these are pending verification, and will then verify them.
This supports:
- Reverification
- Updates of mutable data types (e.g. snippet repos)
Proposal
E.g.:
- In
VerifiableReplicator- Define
event :checksum_succeeded - Define
def handle_after_checksum_succeededwhichpublish(:checksum_succeeded) if Geo.primary?(see e.g.handle_after_create_commit) - Define
def consume_event_checksum_succeededwhich transitions verification state of the registry toverification_pendingso the batch worker picks it up. - Call the hook
handle_after_checksum_succeededafter checksum_succeeded and if primary. E.g. in#verifyor some sub-method- We can't use a
before_transitionsince we want the event to be produced even if the checksum is not changed and the success state remains a success
- We can't use a
- Define
Testing
TBD
Edited by Michael Kozono