Geo: Do not delete object stored files when not GitLab managed
requested to merge 371397-geo-invalid-deletion-on-secondary-when-managed-object-replication-is-disabled into master
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
- 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
- Check into this branch on both sites
- Start both Geo primary and secondary sites
- Enable GitLab-managed object storage replication
- Upload some random files to any issue on your primary site
- Wait until uploads are replicated to your secondary site
- Disable GitLab-managed object storage replication
- Restart the Geo secondary site or wait a few minutes until the cache expires
- 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 on primary but still exist on secondary:
- 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 issue
Related to #371397 (closed)
Edited by Michael Kozono