diff --git a/server/pkg/controller/replication3.go b/server/pkg/controller/replication3.go index a57a372fab..5f611cf215 100644 --- a/server/pkg/controller/replication3.go +++ b/server/pkg/controller/replication3.go @@ -27,8 +27,9 @@ import ( ) const ( - slowUploadThreshold = 2 * time.Second - slowSpeedThreshold = 0.5 // MB/s + slowUploadThreshold = 2 * time.Second + slowSpeedThreshold = 0.5 // MB/s + replicationDelayForStaleObjects = 30 ) // ReplicationController3 oversees version 3 of our object replication. @@ -251,11 +252,11 @@ func (c *ReplicationController3) tryReplicate() error { } if strings.Contains(err.Error(), "size of the uploaded file") { - delayErr := c.ObjectCopiesRepo.DelayNextAttemptByDays(context.Background(), objectKey, 7) + delayErr := c.ObjectCopiesRepo.DelayNextAttemptByDays(context.Background(), objectKey, replicationDelayForStaleObjects) if delayErr != nil { - logger.WithError(delayErr).Error("Failed to delay next attempt by 7 days") + logger.WithError(delayErr).Error("Failed to delay next attempt") } else { - discordAlert := fmt.Sprintf("🔥 Size mismatch for object %s, failed to delay next attempt by 7 days", objectKey) + discordAlert := fmt.Sprintf("🔥 Size mismatch for object %s, deferred next attemp for %d days", objectKey, replicationDelayForStaleObjects) c.notifyDiscord(discordAlert) } }