Skip to content

Geo: Do not delete object stored files when not GitLab managed

What does this MR do and why?

Skips the file removal for files on object storage when GitLab-managed replication is disabled.

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. Check into this branch on both sites
  5. Start both Geo primary and secondary sites
  6. Enable GitLab-managed object storage replication
  7. Upload some random files to any issue on your primary site
  8. Wait until uploads are replicated to your secondary site
  9. Disable GitLab-managed object storage replication
  10. Restart the Geo secondary site or wait a few minutes until the cache expires
  11. 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
  12. 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 on primary but still exist on secondary:
    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 issue

Related to #371397 (closed)

Edited by Michael Kozono

Merge request reports