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_succeeded
whichpublish(:checksum_succeeded) if Geo.primary?
(see e.g.handle_after_create_commit
) - Define
def consume_event_checksum_succeeded
which transitions verification state of the registry toverification_pending
so the batch worker picks it up. - Call the hook
handle_after_checksum_succeeded
after checksum_succeeded and if primary. E.g. in#verify
or some sub-method- We can't use a
before_transition
since 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