From 8c36148325b8d6c1e8ab2cfdf308543f38f09cfe Mon Sep 17 00:00:00 2001 From: Slach Date: Tue, 11 Jun 2024 15:21:11 +0500 Subject: [PATCH] add http_send_timeout=300, http_receive_timeout=300 to embedded backup/restore operations --- ChangeLog.md | 3 +++ pkg/backup/create.go | 2 +- pkg/backup/restore.go | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 02cbede2..0870b3d0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,7 @@ # v2.5.14 +IMPROVEMENTS +- add http_send_timeout=300, http_receive_timeout=300 to embedded backup/restore operations + BUG FIXES - remove too aggressive logs for object disk upload and download operations during create and restore commands execution diff --git a/pkg/backup/create.go b/pkg/backup/create.go index 693cdfc4..e2f0dc10 100644 --- a/pkg/backup/create.go +++ b/pkg/backup/create.go @@ -522,7 +522,7 @@ func (b *Backuper) generateEmbeddedBackupSQL(ctx context.Context, backupName str return "", nil, err } backupSQL := fmt.Sprintf("BACKUP %s TO %s", tablesSQL, embeddedBackupLocation) - var backupSettings []string + backupSettings := []string{"http_send_timeout=300", "http_receive_timeout=300"} if schemaOnly { backupSettings = append(backupSettings, "structure_only=1") } diff --git a/pkg/backup/restore.go b/pkg/backup/restore.go index 8301b838..ef4fa084 100644 --- a/pkg/backup/restore.go +++ b/pkg/backup/restore.go @@ -170,7 +170,7 @@ func (b *Backuper) Restore(backupName, tablePattern string, databaseMapping, par return err } if err = b.dst.Connect(ctx); err != nil { - return fmt.Errorf("restoreBackupEmbedded: can't connect to %s: %v", b.dst.Kind(), err) + return fmt.Errorf("BackupDestination for embedded or object disk: can't connect to %s: %v", b.dst.Kind(), err) } defer func() { if err := b.dst.Close(ctx); err != nil { @@ -1540,7 +1540,7 @@ func (b *Backuper) restoreEmbedded(ctx context.Context, backupName string, schem } } } - var settings []string + settings := []string{"http_send_timeout=300", "http_receive_timeout=300"} if schemaOnly { settings = append(settings, "structure_only=1") }