Fix Geo::FileRegistryRemovalService not removing object stored uploads
requested to merge 368659-geo-fileregistryremovalservice-is-failing-if-uploads-is-configured-with-an-object-storage into master
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
- Set up GitLab Geo using GDK
- Enable object storage on Geo primary site:
- Add the following snippet to the
gdk.yml
:object_store: enabled: true host: '127.0.0.1' port: '9000' console_port: '9002'
- Run
gdk reconfigure
- Add the following snippet to the
- Enable object storage on Geo secondary site:
- Add the following snippet to the
gdk.yml
:object_store: enabled: true host: '127.0.0.1' port: '9001' console_port: '9003'
- Run
gdk reconfigure
- Change the Minio server and console IP address in the Procfile to
127.0.0.1:9001
and127.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
- Add the following snippet to the
- Start both Geo primary and secondary sites
- Enable GitLab-managed object storage replication
- Upload some random files to any issue on your primary site
- 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"
- 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:
- Primary: http://127.0.0.1:9002
- Secondary: http://127.0.0.1:9003
- 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
- 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:
- Primary: http://127.0.0.1:9002
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related issues
Related to #368659 (closed)
Edited by Michael Kozono