Commit e9fe8629 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Throttle some elasticsearch queues

To throttle these queues on the new sidekiq fleet, they need to have
the correct attribute set.

This will exclude them from our SLI for `low` and `high` urgency
queues.
parent 5eeb2ecc
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
- :name: cronjob:elastic_index_bulk_cron - :name: cronjob:elastic_index_bulk_cron
:feature_category: :global_search :feature_category: :global_search
:has_external_dependencies: :has_external_dependencies:
:urgency: :low :urgency: :throttled
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent: true :idempotent: true
...@@ -482,7 +482,7 @@ ...@@ -482,7 +482,7 @@
- :name: elastic_commit_indexer - :name: elastic_commit_indexer
:feature_category: :global_search :feature_category: :global_search
:has_external_dependencies: :has_external_dependencies:
:urgency: :low :urgency: :throttled
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent: :idempotent:
...@@ -496,7 +496,7 @@ ...@@ -496,7 +496,7 @@
- :name: elastic_indexer - :name: elastic_indexer
:feature_category: :global_search :feature_category: :global_search
:has_external_dependencies: :has_external_dependencies:
:urgency: :low :urgency: :throttled
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent: :idempotent:
......
...@@ -5,6 +5,7 @@ class ElasticCommitIndexerWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -5,6 +5,7 @@ class ElasticCommitIndexerWorker # rubocop:disable Scalability/IdempotentWorker
feature_category :global_search feature_category :global_search
sidekiq_options retry: 2 sidekiq_options retry: 2
urgency :throttled
def perform(project_id, oldrev = nil, newrev = nil, wiki = false) def perform(project_id, oldrev = nil, newrev = nil, wiki = false)
return true unless Gitlab::CurrentSettings.elasticsearch_indexing? return true unless Gitlab::CurrentSettings.elasticsearch_indexing?
......
...@@ -10,6 +10,7 @@ class ElasticIndexBulkCronWorker ...@@ -10,6 +10,7 @@ class ElasticIndexBulkCronWorker
feature_category :global_search feature_category :global_search
idempotent! idempotent!
urgency :throttled
def perform def perform
in_lock(self.class.name.underscore, ttl: 10.minutes, retries: 10, sleep_sec: 1) do in_lock(self.class.name.underscore, ttl: 10.minutes, retries: 10, sleep_sec: 1) do
......
...@@ -6,6 +6,7 @@ class ElasticIndexerWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -6,6 +6,7 @@ class ElasticIndexerWorker # rubocop:disable Scalability/IdempotentWorker
sidekiq_options retry: 2 sidekiq_options retry: 2
feature_category :global_search feature_category :global_search
urgency :throttled
def perform(operation, class_name, record_id, es_id, options = {}) def perform(operation, class_name, record_id, es_id, options = {})
return true unless Gitlab::CurrentSettings.elasticsearch_indexing? return true unless Gitlab::CurrentSettings.elasticsearch_indexing?
......
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