Commit 46901efc authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '11743-fix-count-registries' into 'master'

Geo: Does not apply selective sync restrictions while counting registries on the tracking database

Closes #11743

See merge request gitlab-org/gitlab-ee!13257
parents 276b063d 0f77088d
......@@ -19,7 +19,7 @@ module Geo
end
def count_registry
registries_for_attachments.count
Geo::FileRegistry.attachments.count
end
def syncable
......
......@@ -19,7 +19,7 @@ module Geo
end
def count_registry
registries_for_job_artifacts.count
Geo::JobArtifactRegistry.count
end
def syncable
......
......@@ -19,7 +19,7 @@ module Geo
end
def count_registry
registries_for_lfs_objects.count
Geo::FileRegistry.lfs_objects.count
end
def syncable
......
---
title: Geo - Does not apply selective sync restrictions while counting registries
on the tracking database
merge_request: 13257
author:
type: performance
......@@ -427,14 +427,14 @@ describe Geo::AttachmentRegistryFinder, :geo do
secondary.update!(selective_sync_type: 'namespaces', namespaces: [synced_group])
end
it 'counts file registries for attachments' do
it 'does not apply the selective sync restriction' do
create(:geo_file_registry, :attachment, :failed, file_id: upload_1.id, missing_on_primary: true)
create(:geo_file_registry, :attachment, file_id: upload_2.id)
create(:geo_file_registry, :attachment, file_id: upload_3.id)
create(:geo_file_registry, :attachment, file_id: upload_4.id)
create(:geo_file_registry, :attachment, file_id: upload_5.id, missing_on_primary: true)
expect(subject.count_registry).to eq 3
expect(subject.count_registry).to eq 5
end
end
......@@ -443,14 +443,14 @@ describe Geo::AttachmentRegistryFinder, :geo do
secondary.update!(selective_sync_type: 'shards', selective_sync_shards: ['broken'])
end
it 'counts file registries for attachments' do
it 'does not apply the selective sync restriction' do
create(:geo_file_registry, :attachment, :failed, file_id: upload_1.id)
create(:geo_file_registry, :attachment, file_id: upload_2.id, missing_on_primary: true)
create(:geo_file_registry, :attachment, file_id: upload_3.id)
create(:geo_file_registry, :attachment, file_id: upload_4.id)
create(:geo_file_registry, :attachment, file_id: upload_5.id)
expect(subject.count_registry).to eq 3
expect(subject.count_registry).to eq 5
end
end
end
......
......@@ -382,8 +382,8 @@ describe Geo::JobArtifactRegistryFinder, :geo do
secondary.update!(selective_sync_type: 'namespaces', namespaces: [synced_group])
end
it 'counts file registries for job artifacts' do
expect(subject.count_registry).to eq 2
it 'does not apply the selective sync restriction' do
expect(subject.count_registry).to eq 4
end
end
......@@ -392,8 +392,8 @@ describe Geo::JobArtifactRegistryFinder, :geo do
secondary.update!(selective_sync_type: 'shards', selective_sync_shards: ['broken'])
end
it 'counts file registries for job artifacts' do
expect(subject.count_registry).to eq 1
it 'does not apply the selective sync restriction' do
expect(subject.count_registry).to eq 4
end
end
end
......
......@@ -107,13 +107,13 @@ describe Geo::LfsObjectRegistryFinder, :geo do
secondary.update!(selective_sync_type: 'namespaces', namespaces: [synced_group])
end
it 'counts file registries for LFS objects' do
it 'does not apply the selective sync restriction' do
create(:geo_file_registry, :lfs, file_id: lfs_object_remote_1.id)
create(:geo_file_registry, :lfs, file_id: lfs_object_2.id)
create(:geo_file_registry, :lfs, file_id: lfs_object_3.id)
create(:geo_file_registry, :avatar)
expect(subject.count_registry).to eq 1
expect(subject.count_registry).to eq 3
end
end
......@@ -130,13 +130,13 @@ describe Geo::LfsObjectRegistryFinder, :geo do
secondary.update!(selective_sync_type: 'shards', selective_sync_shards: ['broken'])
end
it 'counts file registries for LFS objects' do
it 'does not apply the selective sync restriction' do
create(:geo_file_registry, :lfs, file_id: lfs_object_remote_1.id)
create(:geo_file_registry, :lfs, file_id: lfs_object_2.id)
create(:geo_file_registry, :lfs, file_id: lfs_object_4.id)
create(:geo_file_registry, :avatar)
expect(subject.count_registry).to eq 2
expect(subject.count_registry).to eq 3
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment