Skip to content
  • Michael Kozono's avatar
    Geo: Forward pulls when repo is out of date · d12004f1
    Michael Kozono authored and Andy Schoenen's avatar Andy Schoenen committed
    A secondary site will now forward project repo pulls to the primary site
    if the latest repo change is not yet replicated.
    
    Current limitations:
    
    We assume last_repository_updated_at is a timestamp of the latest
    change. So we compare the timestamp of the latest sync to
    last_repository_updated_at.
    
    - Unfortunately, project wiki updates also touch
      last_repository_updated_at. So wiki updates will also bump the repo to
      out-of-date.
    - Unfortunately, successive last_repository_updated_at touches are
      throttled within Event::REPOSITORY_UPDATED_AT_INTERVAL minutes. This
      is currently set to 5 minutes. So for example, secondary sites will
      think highly active repos are up-to-date after the first sync of each
      5 minute interval.
    
    This is a rough improvement over the current code.
    
    Next, we can iteratively improve the accuracy of
    `.repository_out_of_date?` to fully address the underlying issue. It may
    be rather involved, so this MR helps by reducing the scope of that
    future change.
    d12004f1