Skip to content

Geo: Minor adjustments to verification logic

Michael Kozono requested to merge mk/refactor-verify into master

What does this MR do?

First commit: Perform Replicator#verify even if not "started"

This helped me during manual testing, and I think the logic is more expected this way.

  • Geo::VerificationWorker is already deduplicated for identical args since it is marked idempotent!
  • We actually only care about blocking VerificationBatchWorker from attempting to pick up records which are marked started. This already happens in the query which picks up pending/failed records and marks them started, atomically. So VerificationBatchWorker doesn't conflict with itself. But if a sysadmin wants to attempt a verification manually, or if an event triggers VerificationWorker, it's ok if it runs.
  • When verification_state is not verification_started, it is not necessary for VerificationWorker#perform or Replicator#verify to exit without doing work. Rather, it is unexpected.

Second commit: Allow transition to failed from any state

I ran into this as a one-off problem when testing with local test data which was already invalid. I think this change may avoid other unexpected edge cases.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Michael Kozono

Merge request reports