Skip to content

Geo: Remove Redownload

Michael Kozono requested to merge mk/geo-deprecate-redownload into master

What does this MR do and why?

Describe in detail what your merge request does and why.

  • Removes the "Redownload" button from projects which are in a failed state on /admin/geo/replication/projects
  • Stops using "redownload" codepath

Both items above are revertable by disabling the feature flag with Feature.disable(:geo_deprecate_redownload).

Part of #388868 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

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

Confirm that the "Redownload" button is removed:

  1. Set up Geo
  2. Have a project with a repository
  3. Put a project in a failed replication state with 2+ retries. A shortcut: On the primary in Rails console: Geo::ProjectRegistry.last.update(resync_repository: true, force_to_redownload_repository: false, repository_retry_count: 2, repository_retry_at: 1.day.from_now)
  4. Visit the secondary site in your browser. Your requests must be routed to the secondary site in order to visit the projects replication details page.
  5. Click to Admin > Geo > Sites
  6. In the card for the secondary site, under Replication Details, in the Component column, click Repositories
  7. Click the All projects dropdown and choose Failed
  8. On master branch, observe that Redownload button exists next to the Resync button
  9. On this MR's branch, observe that Redownload button does not exist

Confirm that the button can be brought back by disabling the feature flag:

  1. On this MR's branch, disable the feature flag in Rails console with Feature.disable(:geo_deprecate_redownload) and confirm the change on the secondary site: Feature.enabled?(:geo_deprecate_redownload) (I think the cache invalidation is not working so the effect may be delayed by a couple minutes?)
  2. Observe that the Redownload button exists.
  3. Side note-- clicking Redownload merely flags the record to use redownload logic at the already-scheduled next retry time.

Confirm that redownload works:

  1. Make a project redownload now. In Rails console on the secondary site: r = Geo::ProjectRegistry.last; r.update(resync_repository: true, force_to_redownload_repository: true, repository_retry_count: 2, repository_retry_at: 1.day.ago)
  2. Wait a minute or two for the background jobs to run
  3. The registry should become "synced": In Rails console on the secondary site: r.reload, observe resync_repository: false

Confirm that resync without redownload works:

  1. Enable the feature flag in Rails console on the primary site: Feature.enable(:geo_deprecate_redownload) and confirm the change on the secondary site: Feature.enabled?(:geo_deprecate_redownload)
  2. Make a project resync now. In Rails console on the secondary site: r = Geo::ProjectRegistry.last; r.update(resync_repository: true, repository_retry_count: 2, repository_retry_at: 1.day.ago) (Note that it shouldn't make a difference if you try to "force redownload")
  3. Wait a minute or two for the background jobs to run
  4. The registry should become "synced": In Rails console on the secondary site: r.reload, observe resync_repository: false

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