Skip to content

Commit

Permalink
increase s3_request_timeout_ms (23.7+) and turn off `s3_use_adaptiv…
Browse files Browse the repository at this point in the history
…e_timeouts` (23.11+) when `use_embedded_backup_restore: true`
  • Loading branch information
Slach committed Jun 20, 2024
1 parent c6acfa1 commit 72ecd52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# v2.5.15
IMPROVEMENTS
- increase `s3_request_timeout_ms` (23.7+) and turn off `s3_use_adaptive_timeouts` (23.11+) when `use_embedded_backup_restore: true`

BUG FIXES
- fix hangs `create` and `restore` when CLICKHOUSE_MAX_CONNECTIONS=0, fix [933](https://github.com/Altinity/clickhouse-backup/issues/933)
- remove obsolete `CLICKHOUSE_EMBEDDED_BACKUP_THREADS`, `CLICKHOUSE_EMBEDDED_BACKUP_THREADS` these settings could configure only via server level, not profile and query settings after 23.3
Expand Down
13 changes: 11 additions & 2 deletions pkg/backup/backuper.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,19 @@ func (b *Backuper) isDiskTypeEncryptedObject(disk clickhouse.Disk, disks []click

func (b *Backuper) getEmbeddedBackupDefaultSettings(version int) []string {
settings := []string{}
if (b.cfg.General.RemoteStorage == "s3" || b.cfg.General.RemoteStorage == "gcs") && version > 23007001 {
if (b.cfg.General.RemoteStorage == "s3" || b.cfg.General.RemoteStorage == "gcs") && version >= 23007000 {
settings = append(settings, "allow_s3_native_copy=1")
if err := b.ch.Query("SET s3_request_timeout_ms=600000"); err != nil {
b.log.Fatalf("SET s3_request_timeout_ms=600000 error: %v", err)
}

}
if (b.cfg.General.RemoteStorage == "s3" || b.cfg.General.RemoteStorage == "gcs") && version >= 23011000 {
if err := b.ch.Query("SET s3_use_adaptive_timeouts=0"); err != nil {
b.log.Fatalf("SET s3_use_adaptive_timeouts=0 error: %v", err)
}
}
if b.cfg.General.RemoteStorage == "azblob" && version >= 24005001 {
if b.cfg.General.RemoteStorage == "azblob" && version >= 24005000 {
settings = append(settings, "allow_azure_native_copy=1")
}
return settings
Expand Down

0 comments on commit 72ecd52

Please sign in to comment.