]> git.proxmox.com Git - pve-guest-common.git/commitdiff
replication config: retry first three failed times quicker before going to 30m
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Apr 2022 07:59:24 +0000 (09:59 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Apr 2022 07:59:26 +0000 (09:59 +0200)
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 <t.lamprecht@proxmox.com>
src/PVE/ReplicationState.pm

index 8efe0e26f25fb641569531df1d02d35438c0c27b..0a5e410db66aeff06abc9f2affa3f72f0f7c2e73 100644 (file)
@@ -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';