From 3cc3f7a1f18f0b33e9697a258b004f86da01decd Mon Sep 17 00:00:00 2001 From: Gregorius Marco Date: Tue, 8 Apr 2025 15:41:47 +0800 Subject: [PATCH 1/3] Remove worker data consistency feature flag Remove feature flags load_balancing_for_flush_counter_increments_worker and load_balancing_for_web_hooks_log_execution_worker, used for switching the data_consistency attribute for FlushCounterIncrementsWorker and WebHooks::LogExecutionWorker. Changelog: other --- app/workers/flush_counter_increments_worker.rb | 2 +- app/workers/web_hooks/log_execution_worker.rb | 2 +- ...oad_balancing_for_flush_counter_increments_worker.yml | 9 --------- ...load_balancing_for_web_hooks_log_execution_worker.yml | 9 --------- 4 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 config/feature_flags/worker/load_balancing_for_flush_counter_increments_worker.yml delete mode 100644 config/feature_flags/worker/load_balancing_for_web_hooks_log_execution_worker.yml diff --git a/app/workers/flush_counter_increments_worker.rb b/app/workers/flush_counter_increments_worker.rb index dcf681fa0b856a..105070c333a85c 100644 --- a/app/workers/flush_counter_increments_worker.rb +++ b/app/workers/flush_counter_increments_worker.rb @@ -8,7 +8,7 @@ class FlushCounterIncrementsWorker include ApplicationWorker - data_consistency :delayed, feature_flag: :load_balancing_for_flush_counter_increments_worker + data_consistency :delayed sidekiq_options retry: 3 loggable_arguments 0, 2 diff --git a/app/workers/web_hooks/log_execution_worker.rb b/app/workers/web_hooks/log_execution_worker.rb index c6941e6ba0e03d..e2204fc034d815 100644 --- a/app/workers/web_hooks/log_execution_worker.rb +++ b/app/workers/web_hooks/log_execution_worker.rb @@ -4,7 +4,7 @@ module WebHooks class LogExecutionWorker include ApplicationWorker - data_consistency :delayed, feature_flag: :load_balancing_for_web_hooks_log_execution_worker + data_consistency :delayed feature_category :webhooks urgency :low sidekiq_options retry: 3 diff --git a/config/feature_flags/worker/load_balancing_for_flush_counter_increments_worker.yml b/config/feature_flags/worker/load_balancing_for_flush_counter_increments_worker.yml deleted file mode 100644 index 59687c9897ab4b..00000000000000 --- a/config/feature_flags/worker/load_balancing_for_flush_counter_increments_worker.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: load_balancing_for_flush_counter_increments_worker -feature_issue_url: https://gitlab.com/gitlab-com/gl-infra/data-access/durability/team/-/issues/121 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186079 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/527277 -milestone: '17.11' -group: group::durability -type: worker -default_enabled: false diff --git a/config/feature_flags/worker/load_balancing_for_web_hooks_log_execution_worker.yml b/config/feature_flags/worker/load_balancing_for_web_hooks_log_execution_worker.yml deleted file mode 100644 index 012394fd02b4ae..00000000000000 --- a/config/feature_flags/worker/load_balancing_for_web_hooks_log_execution_worker.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: load_balancing_for_web_hooks_log_execution_worker -feature_issue_url: https://gitlab.com/gitlab-com/gl-infra/data-access/durability/team/-/issues/121 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186079 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/527276 -milestone: '17.11' -group: group::durability -type: worker -default_enabled: false -- GitLab From 3813fb23d60e6a439055e9ab90f27e9c3f619045 Mon Sep 17 00:00:00 2001 From: Gregorius Marco Date: Tue, 8 Apr 2025 18:38:52 +0800 Subject: [PATCH 2/3] Add worker with data consistency spec --- spec/workers/flush_counter_increments_worker_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/workers/flush_counter_increments_worker_spec.rb b/spec/workers/flush_counter_increments_worker_spec.rb index 1bdda3100c9eb0..40c1445bf2c03a 100644 --- a/spec/workers/flush_counter_increments_worker_spec.rb +++ b/spec/workers/flush_counter_increments_worker_spec.rb @@ -6,6 +6,8 @@ let(:project_statistics) { create(:project_statistics) } let(:model) { CounterAttributeModel.find(project_statistics.id) } + it_behaves_like 'worker with data consistency', described_class, data_consistency: :delayed + describe '#perform', :redis do let(:attribute) { model.class.counter_attributes.first } let(:worker) { described_class.new } -- GitLab From 67edcb9a4657a510891f4fb85b3a4f609aad0169 Mon Sep 17 00:00:00 2001 From: Gregorius Marco Date: Wed, 9 Apr 2025 15:59:34 +0800 Subject: [PATCH 3/3] add specs for LogExecutionWorker --- .../sidekiq_load_balancing/worker_data_consistency.yml | 2 -- spec/workers/web_hooks/log_execution_worker_spec.rb | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 spec/workers/web_hooks/log_execution_worker_spec.rb diff --git a/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml b/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml index 3eb3f299d83f7a..68f450a1bbf902 100644 --- a/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml +++ b/.rubocop_todo/sidekiq_load_balancing/worker_data_consistency.yml @@ -75,7 +75,6 @@ SidekiqLoadBalancing/WorkerDataConsistency: - 'app/workers/expire_build_artifacts_worker.rb' - 'app/workers/export_csv_worker.rb' - 'app/workers/file_hook_worker.rb' - - 'app/workers/flush_counter_increments_worker.rb' - 'app/workers/gitlab/github_gists_import/finish_import_worker.rb' - 'app/workers/gitlab/github_gists_import/import_gist_worker.rb' - 'app/workers/gitlab/github_gists_import/start_import_worker.rb' @@ -238,7 +237,6 @@ SidekiqLoadBalancing/WorkerDataConsistency: - 'app/workers/users/unconfirmed_secondary_emails_deletion_cron_worker.rb' - 'app/workers/wait_for_cluster_creation_worker.rb' - 'app/workers/web_hooks/log_destroy_worker.rb' - - 'app/workers/web_hooks/log_execution_worker.rb' - 'app/workers/work_items/import_work_items_csv_worker.rb' - 'app/workers/x509_certificate_revoke_worker.rb' - 'app/workers/x509_issuer_crl_check_worker.rb' diff --git a/spec/workers/web_hooks/log_execution_worker_spec.rb b/spec/workers/web_hooks/log_execution_worker_spec.rb new file mode 100644 index 00000000000000..73eb61b5a8939a --- /dev/null +++ b/spec/workers/web_hooks/log_execution_worker_spec.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe WebHooks::LogExecutionWorker, feature_category: :webhooks do + it_behaves_like 'worker with data consistency', described_class, data_consistency: :delayed +end -- GitLab