Commit 8ce236fc authored by Mike Kozono's avatar Mike Kozono

Rename Geo VerificationWorker

Since it is reusable on primaries and secondaries.
parent 20743441
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class MigrateGeoBlobVerificationPrimaryWorkerSidekiqQueue < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
sidekiq_queue_migrate 'geo:geo_blob_verification_primary', to: 'geo:geo_verification'
end
def down
sidekiq_queue_migrate 'geo:geo_verification', to: 'geo:geo_blob_verification_primary'
end
end
87e330bc15accb10733825b079cf89e78d905a7c4080075489857085f014bfe7
\ No newline at end of file
...@@ -67,7 +67,7 @@ module Geo ...@@ -67,7 +67,7 @@ module Geo
end end
def schedule_checksum_calculation def schedule_checksum_calculation
Geo::BlobVerificationPrimaryWorker.perform_async(replicable_name, model_record.id) Geo::VerificationWorker.perform_async(replicable_name, model_record.id)
end end
end end
end end
...@@ -323,14 +323,6 @@ ...@@ -323,14 +323,6 @@
:weight: 1 :weight: 1
:idempotent: :idempotent:
:tags: [] :tags: []
- :name: geo:geo_blob_verification_primary
:feature_category: :geo_replication
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight: 1
:idempotent: true
:tags: []
- :name: geo:geo_container_repository_sync - :name: geo:geo_container_repository_sync
:feature_category: :geo_replication :feature_category: :geo_replication
:has_external_dependencies: :has_external_dependencies:
...@@ -499,6 +491,14 @@ ...@@ -499,6 +491,14 @@
:weight: 1 :weight: 1
:idempotent: :idempotent:
:tags: [] :tags: []
- :name: geo:geo_verification
:feature_category: :geo_replication
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight: 1
:idempotent: true
:tags: []
- :name: personal_access_tokens:personal_access_tokens_groups_policy - :name: personal_access_tokens:personal_access_tokens_groups_policy
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
......
# frozen_string_literal: true # frozen_string_literal: true
module Geo module Geo
class BlobVerificationPrimaryWorker class VerificationWorker
include ApplicationWorker include ApplicationWorker
include GeoQueue include GeoQueue
include ::Gitlab::Geo::LogHelpers include ::Gitlab::Geo::LogHelpers
...@@ -16,7 +16,7 @@ module Geo ...@@ -16,7 +16,7 @@ module Geo
replicator.calculate_checksum! replicator.calculate_checksum!
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
log_error("Couldn't find the blob, skipping", replicable_name: replicable_name, replicable_id: replicable_id) log_error("Couldn't find the record, skipping", replicable_name: replicable_name, replicable_id: replicable_id)
end end
end end
end end
---
title: Migrate renamed Sidekiq queue
merge_request: 45964
author:
type: changed
...@@ -28,11 +28,11 @@ RSpec.describe Packages::PackageFile, type: :model do ...@@ -28,11 +28,11 @@ RSpec.describe Packages::PackageFile, type: :model do
context 'new file' do context 'new file' do
it 'calls checksum worker' do it 'calls checksum worker' do
allow(Gitlab::Geo).to receive(:enabled?).and_return(true) allow(Gitlab::Geo).to receive(:enabled?).and_return(true)
allow(Geo::BlobVerificationPrimaryWorker).to receive(:perform_async) allow(Geo::VerificationWorker).to receive(:perform_async)
package_file = create(:conan_package_file, :conan_recipe_file) package_file = create(:conan_package_file, :conan_recipe_file)
expect(Geo::BlobVerificationPrimaryWorker).to have_received(:perform_async).with('package_file', package_file.id) expect(Geo::VerificationWorker).to have_received(:perform_async).with('package_file', package_file.id)
end end
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Geo::BlobVerificationPrimaryWorker, :geo do RSpec.describe Geo::VerificationWorker, :geo do
let(:package_file) { create(:conan_package_file, :conan_recipe_file) } let(:package_file) { create(:conan_package_file, :conan_recipe_file) }
describe '#perform' do describe '#perform' do
......
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