Skip to content

Commit 122495e

Browse files
committed
Add S3_RETRY_MODE with standard and adaptive, fix #1097, fix testflows
Signed-off-by: Slach <bloodjazman@gmail.com>
1 parent 5a36566 commit 122495e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

ChangeLog.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
IMPROVEMENTS
44

5+
- Add `S3_RETRY_MODE` with `standard` and `adaptive`, fix [1097](https://github.com/Altinity/clickhouse-backup/issues/1097)
56
- Add `server_side_encryption_kms_bucket_key_enabled` support for backup/restore s3 object disks, fix [1092](https://github.com/Altinity/clickhouse-backup/issues/1092)
67
- Add `AZBLOB_ASSUME_CONTAINER_EXISTS` config option, fix [1094](https://github.com/Altinity/clickhouse-backup/pull/1094), thanks @atykhyy
78
- Improve Azure authentication mechanism, fix [1047](https://github.com/Altinity/clickhouse-backup/issues/1047), thanks @dnovvak
89
- Add option `--skip-projections` to `create`, `upload`, `restore` commands, with table pattern to allow make backup
910
without projection, restore supported only in `clickhouse-server` 24.3+, fix [861](https://github.com/Altinity/clickhouse-backup/issues/861)
10-
- remove `S3_PART_SIZE` and `AZBLOB_BUFFER_SIZE` parameter from configuration and significant decrease memory usage
11+
- Remove `S3_PART_SIZE` and `AZBLOB_BUFFER_SIZE` parameter from configuration and significant decrease memory usage
1112
during upload and download, fix [854](https://github.com/Altinity/clickhouse-backup/issues/854)
12-
- add `--configs-only` and `--rbac-only` options to `upload` and `download` command, fix [1042](https://github.com/Altinity/clickhouse-backup/issues/1042)
13-
- add support `\` and `/` special characters in table name and database name, fix [1091](https://github.com/Altinity/clickhouse-backup/issues/1091)
13+
- Add `--configs-only` and `--rbac-only` options to `upload` and `download` command, fix [1042](https://github.com/Altinity/clickhouse-backup/issues/1042)
14+
- Add support `\` and `/` special characters in table name and database name, fix [1091](https://github.com/Altinity/clickhouse-backup/issues/1091)
1415

1516
BUG FIXES
1617

pkg/config/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package config
33
import (
44
"crypto/tls"
55
"fmt"
6+
"github.com/aws/aws-sdk-go-v2/aws"
67
"math"
78
"os"
89
"regexp"
@@ -148,6 +149,7 @@ type S3Config struct {
148149
ObjectLabels map[string]string `yaml:"object_labels" envconfig:"S3_OBJECT_LABELS"`
149150
RequestPayer string `yaml:"request_payer" envconfig:"S3_REQUEST_PAYER"`
150151
CheckSumAlgorithm string `yaml:"check_sum_algorithm" envconfig:"S3_CHECKSUM_ALGORITHM"`
152+
RetryMode string `yaml:"retry_mode" envconfig:"S3_RETRY_MODE"`
151153
Debug bool `yaml:"debug" envconfig:"S3_DEBUG"`
152154
}
153155

@@ -373,6 +375,11 @@ func LoadConfig(configLocation string) (*Config, error) {
373375
}
374376

375377
func ValidateConfig(cfg *Config) error {
378+
if cfg.General.RemoteStorage == "s3" {
379+
if _, err := aws.ParseRetryMode(cfg.S3.RetryMode); err != nil {
380+
return err
381+
}
382+
}
376383
if cfg.GetCompressionFormat() == "unknown" {
377384
return fmt.Errorf("'%s' is unknown remote storage", cfg.General.RemoteStorage)
378385
}
@@ -601,6 +608,7 @@ func DefaultConfig() *Config {
601608
StorageClass: string(s3types.StorageClassStandard),
602609
Concurrency: int(downloadConcurrency + 1),
603610
MaxPartsCount: 4000,
611+
RetryMode: string(aws.RetryModeStandard),
604612
},
605613
GCS: GCSConfig{
606614
CompressionLevel: 1,

test/testflows/clickhouse_backup/tests/cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def list_local_remote(self):
153153
"""
154154
backup = self.context.backup
155155
name_prefix = "cli_list"
156+
location_index = 3
156157

157158
try:
158159
with Given("create a local backup"):
@@ -175,7 +176,7 @@ def list_local_remote(self):
175176
for line in data:
176177
debug(line)
177178
total_backups += 1
178-
assert line[4] in ("local", "remote"), error()
179+
assert line[location_index] in ("local", "remote"), error()
179180

180181
with By("check local backups"):
181182
local_backups = 0
@@ -187,7 +188,7 @@ def list_local_remote(self):
187188
for line in data:
188189
debug(line)
189190
local_backups += 1
190-
assert line[4] == "local", error()
191+
assert line[location_index] == "local", error()
191192

192193
with By("check remote backups"):
193194
remote_backups = 0
@@ -199,7 +200,7 @@ def list_local_remote(self):
199200
for line in data:
200201
debug(line)
201202
remote_backups += 1
202-
assert line[4] == "remote", error()
203+
assert line[location_index] == "remote", error()
203204

204205
with By("I expect total number to match"):
205206
assert total_backups == local_backups + remote_backups, error()

0 commit comments

Comments
 (0)