From 73a3e4cb237d39de2b4a4dae146d0785ec86f529 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 27 Apr 2022 09:59:24 +0200 Subject: [PATCH] replication config: retry first three failed times quicker before going to 30m So the repeat frequency for a stuck job is now: t0 -> fails t1 = t0 + 5m -> repat t2 = t1 + 10m = t0 + 15m -> repat t3 = t2 + 15m = t0 + 30m -> repat t4 = t3 + 30m = t0 + 60-> repat then tx = tx-1 + 30m -> repat So, we converge more naturally/stable to the 30m intervals than before, when t3 would have been t0 + 45m. Signed-off-by: Thomas Lamprecht --- src/PVE/ReplicationState.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/ReplicationState.pm b/src/PVE/ReplicationState.pm index 8efe0e2..0a5e410 100644 --- a/src/PVE/ReplicationState.pm +++ b/src/PVE/ReplicationState.pm @@ -288,7 +288,7 @@ sub job_status { if (my $fail_count = $state->{fail_count}) { my $members = PVE::Cluster::get_members(); if (!$fail_count || ($members->{$target} && $members->{$target}->{online})) { - $next_sync = $state->{last_try} + 60*($fail_count < 3 ? 5*$fail_count : 30); + $next_sync = $state->{last_try} + 60 * ($fail_count <= 3 ? 5 * $fail_count : 30); } } else { my $schedule = $jobcfg->{schedule} || '*/15'; -- 2.39.5