Geo: Fix replicable attachments when sync object storage is disabled
What does this MR do?
This fixes a regression. When sync object storage is disabled, object stored uploads should not be synced.
- This
attachments
method is only used at https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/finders/geo/attachment_registry_finder.rb#L28, which is scoped to a range of IDs (spanning a max of 1000 records), and only selectsid
anduploader
values. - This MR only adds
WHERE "uploads"."file_store" = 1
to the scope whensync_object_storage
is disabled.- This technique is also already used on job artifacts and LFS objects at https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/finders/geo/file_registry_finder.rb#L57, but that method was overridden for attachments, which is likely when the regression was introduced.
- I fixed it at
#attachments
rather than#find_registry_differences
since I think that's a better place to apply the scope.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Michael Kozono