Commit f293b14a authored by Mark Chao's avatar Mark Chao

Merge branch 'mk/geo-deduplicate-until-executed' into 'master'

Deduplicate Geo cronjobs

See merge request gitlab-org/gitlab!59799
parents 0c171090 fee9723c
......@@ -13,6 +13,13 @@ module Geo
feature_category :geo_replication
# These workers are enqueued every minute by sidekiq-cron. If one of them
# is already enqueued or running, then there isn't a strong case for
# enqueuing another. And there are edge cases where enqueuing another
# would exacerbate a problem. See
# https://gitlab.com/gitlab-org/gitlab/-/issues/328057.
deduplicate :until_executed
def perform
each_eligible_shard { |shard_name| schedule_job(shard_name) }
end
......
......@@ -10,6 +10,14 @@ module Geo
include ::Gitlab::Utils::StrongMemoize
include GeoBackoffDelay
# These workers are enqueued regularly by sidekiq-cron or by an per-shard
# worker which is enqueued by sidekiq-cron. If one of these workers is
# already enqueued or running, then there isn't a strong case for
# enqueuing another. And there are edge cases where enqueuing another
# would exacerbate a problem. See
# https://gitlab.com/gitlab-org/gitlab/-/issues/328057.
deduplicate :until_executed
DB_RETRIEVE_BATCH_SIZE = 1000
LEASE_TIMEOUT = 60.minutes
RUN_TIME = 60.minutes.to_i
......
---
title: Deduplicate Geo cronjobs
merge_request: 59799
author:
type: performance
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