Skip to content

Fix Geo::FileRegistryRemovalService not removing object stored uploads

What does this MR do and why?

This MR fixes the Geo::FileRegistryRemovalService not removing uploads on object storage. This also improves the test coverage for this service.

How to set up and validate locally

  1. Set up GitLab Geo using GDK
  2. Enable object storage on Geo primary site:
    1. Add the following snippet to the gdk.yml:
      object_store:
        enabled: true
        host: '127.0.0.1'
        port: '9000'
        console_port: '9002'
    2. Run gdk reconfigure
  3. Enable object storage on Geo secondary site:
    1. Add the following snippet to the gdk.yml:
      object_store:
        enabled: true
        host: '127.0.0.1'
        port: '9001'
        console_port: '9003'
    2. Run gdk reconfigure
    3. Change the Minio server and console IP address in the Procfile to 127.0.0.1:9001 and 127.0.0.1:9003, respectively:
      minio: exec /usr/bin/env MINIO_REGION=gdk MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=gdk-minio minio server -C minio/config --address "127.0.0.1:9001" --console-address "127.0.0.1:9003" --compat minio/data
  4. Start both Geo primary and secondary sites
  5. Enable GitLab-managed object storage replication
  6. Upload some random files to any issue on your primary site
  7. In a Rails console session on your primary site, check the path of the latest upload:
    upload = Upload.last
    upload.path
    => => "@hashed/f5/ca/f5ca38f748a1d6eaf726b8a42fb575c3c71f1864a8143301782de13da2d9202b/121da8a181a7d4f3de50169cfbad4799/test.pdf"
  8. Open the Minio console for both servers on Web Browser (username/password can be found in your Procfile) and check if the file above exists:
    1. Primary: http://127.0.0.1:9002
    2. Secondary: http://127.0.0.1:9003
  9. In a Rails console session on your primary site, delete the latest upload:
    upload = Upload.last
    upload.path
    => => "@hashed/f5/ca/f5ca38f748a1d6eaf726b8a42fb575c3c71f1864a8143301782de13da2d9202b/121da8a181a7d4f3de50169cfbad4799/test.pdf"
    upload.destroy
  10. Open the Minio console for both servers on Web Browser (username/password can be found in your Procfile) and check if the file above does not exist:
    1. Primary: http://127.0.0.1:9002
    2. Secondary: http://127.0.0.1:9003

MR acceptance checklist

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

Related issues

Related to #368659 (closed)

Edited by Michael Kozono

Merge request reports

Loading