Skip to content

Geo: Fix reverify object stored files

Michael Kozono requested to merge mk/fix-reverify-object-storage into master

What does this MR do and why?

Describe in detail what your merge request does and why.

!79303 (merged) marked verification succeeded upon a successful sync of an object stored file.

But Geo regularly reverifies all resources, and in that case, the verification would fail and cause an unnecessary resync. The default reverification interval is 7 days. To avoid confusion, we need to resolve this case as well.

This MR fixes it so that regardless of where #verify is called from, it will mark object stored files as verification succeeded. Technically with this more complete fix, we don't need the changes to after_synced in !79303 (merged). But this MR does depend on the other methods in !79303 (merged).

Related to #299819 (comment 822629467) and !79357 (diffs, comment 825477348)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  • On master branch, with Geo setup, with object storage configured for at least Uploads, with "Allow replication of object stored files" enabled for the secondary site
  • Add an attachment to an issue or MR
  • See that it syncs and "verifies successfully" thanks to !79303 (merged)
  • Now run in Rails console Geo::UploadRegistry.last.replicator.verify
  • Inspect the registry Geo::UploadRegistry.last
  • Notice that verification failed and also sync is now marked failed
  • Make it synced and verified again with Geo::UploadRegistry.last.replicator.consume_event_created
  • Inspect the registry Geo::UploadRegistry.last to double check
  • Switch to this MR's branch
  • In Rails console, run reload!
  • Now run in Rails console Geo::UploadRegistry.last.replicator.verify
  • Inspect the registry Geo::UploadRegistry.last
  • Notice that verification succeeded and it's still marked synced

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Michael Kozono

Merge request reports