Geo: Fix undefined method 'log_error' in BlobDownloader

What does this MR do and why?

Gitlab::Geo::Replication::BlobDownloader was calling log_error but only included EE::GeoHelper, which does not define that method. This adds ::Gitlab::Geo::LogHelpers to BlobDownloader so that directory creation failures are logged correctly instead of raising a NoMethodError that masks the real sync error.

References

#598565 (closed)

How to set up and validate locally

Before the change:

  • patch Gitlab::Geo::Replication::BlobDownloader with a new method:
def test_log
  log_error('oops')
end
  • In the Rails console, run:
replicator = Project.first.replicator
bd = Gitlab::Geo::Replication::BlobDownloader.new(replicator:)
bd.test_log
  • See it raise a NoMethodError exception
  • Stash the patch

After the change:

  • Checkout the branch.
  • Un-stash the patch, restart the Rails console and repeat the steps.
  • Now db.test_log should return true, as asserted by the new spec added.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Chloe Fons

Merge request reports

Loading