Commit 5c086658 authored by Matthias Kaeppler's avatar Matthias Kaeppler

Enable load balancing in ExpirePipelineCacheWorker

By marking it delayed. This will enable the use
of read replicas as long as they're caught up.
parent b3a41f0d
...@@ -1428,7 +1428,7 @@ ...@@ -1428,7 +1428,7 @@
:urgency: :high :urgency: :high
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent: true :idempotent:
:tags: [] :tags: []
- :name: pipeline_creation:create_pipeline - :name: pipeline_creation:create_pipeline
:worker_name: CreatePipelineWorker :worker_name: CreatePipelineWorker
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop: disable Scalability/IdempotentWorker
class ExpirePipelineCacheWorker class ExpirePipelineCacheWorker
include ApplicationWorker include ApplicationWorker
...@@ -9,8 +10,12 @@ class ExpirePipelineCacheWorker ...@@ -9,8 +10,12 @@ class ExpirePipelineCacheWorker
queue_namespace :pipeline_cache queue_namespace :pipeline_cache
urgency :high urgency :high
worker_resource_boundary :cpu worker_resource_boundary :cpu
data_consistency :delayed, feature_flag: :load_balancing_for_expire_pipeline_cache_worker
idempotent! # This worker _should_ be idempotent, but due to us moving this to data_consistency :delayed
# and an ongoing incompatibility between the two switches, we need to disable this.
# Uncomment once https://gitlab.com/gitlab-org/gitlab/-/issues/325291 is resolved
# idempotent!
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def perform(pipeline_id) def perform(pipeline_id)
...@@ -21,3 +26,4 @@ class ExpirePipelineCacheWorker ...@@ -21,3 +26,4 @@ class ExpirePipelineCacheWorker
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
end end
# rubocop:enable Scalability/IdempotentWorker
---
name: load_balancing_for_expire_pipeline_cache_worker
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62073
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/331360
milestone: '14.0'
type: development
group: group::memory
default_enabled: false
...@@ -42,8 +42,15 @@ RSpec.describe ExpirePipelineCacheWorker do ...@@ -42,8 +42,15 @@ RSpec.describe ExpirePipelineCacheWorker do
subject.perform(617748) subject.perform(617748)
end end
skip "with https://gitlab.com/gitlab-org/gitlab/-/issues/325291 resolved" do
it_behaves_like 'an idempotent worker' do it_behaves_like 'an idempotent worker' do
let(:job_args) { [pipeline.id] } let(:job_args) { [pipeline.id] }
end end
end end
it_behaves_like 'worker with data consistency',
described_class,
feature_flag: :load_balancing_for_expire_pipeline_cache_worker,
data_consistency: :delayed
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