Skip to content
代码片段 群组 项目
提交 8631ff00 编辑于 作者: Krasimir Angelov's avatar Krasimir Angelov
浏览文件

Update partition manager lock retries config

Less retries, shorter sleep intervals. Partitions are synced often
enough, if lock can not be obtained  move to the next one instead of
retrying as if it's a migration.
上级 ade4691b
No related branches found
No related tags found
无相关合并请求
......@@ -13,6 +13,19 @@ class PartitionManager
MANAGEMENT_LEASE_KEY = 'database_partition_management_%s'
RETAIN_DETACHED_PARTITIONS_FOR = 1.week
LOCK_RETRIES_TIMING_CONFIGURATION = [
[0.1.seconds, 0.05.seconds],
[0.1.seconds, 0.05.seconds],
[0.2.seconds, 0.05.seconds],
[0.3.seconds, 0.10.seconds],
[0.4.seconds, 0.15.seconds],
[0.5.seconds, 2.seconds],
[0.5.seconds, 2.seconds],
[0.5.seconds, 2.seconds],
[0.5.seconds, 2.seconds],
[1.second, 5.seconds]
].freeze
def initialize(model, connection: nil)
@model = model
@connection = connection || model.connection
......@@ -135,6 +148,7 @@ def assert_partition_detachable!(partition)
def with_lock_retries(&block)
Gitlab::Database::WithLockRetries.new(
timing_configuration: LOCK_RETRIES_TIMING_CONFIGURATION * 2,
klass: self.class,
logger: Gitlab::AppLogger,
connection: connection
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册