Skip to content

Commit

Permalink
remove obsolete CLICKHOUSE_EMBEDDED_BACKUP_THREADS, `CLICKHOUSE_EMB…
Browse files Browse the repository at this point in the history
…EDDED_BACKUP_THREADS` these settings could configure only via server level, not profile and query settings after 23.3
  • Loading branch information
Slach committed Jun 20, 2024
1 parent 7707ecd commit 4a1b8af
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# v2.5.15
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

# v2.5.14
IMPROVEMENTS
Expand Down
2 changes: 0 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ clickhouse:
check_replicas_before_attach: true # CLICKHOUSE_CHECK_REPLICAS_BEFORE_ATTACH, helps avoiding concurrent ATTACH PART execution when restoring ReplicatedMergeTree tables
use_embedded_backup_restore: false # CLICKHOUSE_USE_EMBEDDED_BACKUP_RESTORE, use BACKUP / RESTORE SQL statements instead of regular SQL queries to use features of modern ClickHouse server versions
embedded_backup_disk: "" # CLICKHOUSE_EMBEDDED_BACKUP_DISK - disk from system.disks which will use when `use_embedded_backup_restore: true`
embedded_backup_threads: 0 # CLICKHOUSE_EMBEDDED_BACKUP_THREADS - how many threads will use for BACKUP sql command when `use_embedded_backup_restore: true`, 0 means - equal available CPU cores
embedded_restore_threads: 0 # CLICKHOUSE_EMBEDDED_RESTORE_THREADS - how many threads will use for RESTORE sql command when `use_embedded_backup_restore: true`, 0 means - equal available CPU cores
backup_mutations: true # CLICKHOUSE_BACKUP_MUTATIONS, allow backup mutations from system.mutations WHERE is_done=0 and apply it during restore
restore_as_attach: false # CLICKHOUSE_RESTORE_AS_ATTACH, allow restore tables which have inconsistent data parts structure and mutations in progress
check_parts_columns: true # CLICKHOUSE_CHECK_PARTS_COLUMNS, check data types from system.parts_columns during create backup to guarantee mutation is complete
Expand Down
5 changes: 1 addition & 4 deletions pkg/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,6 @@ func (b *Backuper) generateEmbeddedBackupSQL(ctx context.Context, backupName str
if schemaOnly {
backupSettings = append(backupSettings, "structure_only=1")
}
if b.cfg.ClickHouse.EmbeddedBackupThreads > 0 {
backupSettings = append(backupSettings, fmt.Sprintf("backup_threads=%d", b.cfg.ClickHouse.EmbeddedBackupThreads))
}
// incremental native backup https://github.com/Altinity/clickhouse-backup/issues/735
if baseBackup != "" {
baseBackup, err = b.getEmbeddedBackupLocation(ctx, baseBackup)
Expand Down Expand Up @@ -825,7 +822,7 @@ func (b *Backuper) uploadObjectDiskParts(ctx context.Context, backupName string,
ctx, cancel := context.WithCancel(ctx)
defer cancel()
uploadObjectDiskPartsWorkingGroup, ctx := errgroup.WithContext(ctx)
uploadObjectDiskPartsWorkingGroup.SetLimit(int(b.cfg.General.ObjectDiskServerSizeCopyConcurrency))
uploadObjectDiskPartsWorkingGroup.SetLimit(int(b.cfg.General.ObjectDiskServerSideCopyConcurrency))
srcDiskConnection, exists := object_disk.DisksConnections.Load(disk.Name)
if !exists {
return 0, fmt.Errorf("uploadObjectDiskParts: %s not present in object_disk.DisksConnections", disk.Name)
Expand Down
5 changes: 1 addition & 4 deletions pkg/backup/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ func (b *Backuper) downloadObjectDiskParts(ctx context.Context, backupName strin
}
start := time.Now()
downloadObjectDiskPartsWorkingGroup, downloadCtx := errgroup.WithContext(ctx)
downloadObjectDiskPartsWorkingGroup.SetLimit(int(b.cfg.General.ObjectDiskServerSizeCopyConcurrency))
downloadObjectDiskPartsWorkingGroup.SetLimit(int(b.cfg.General.ObjectDiskServerSideCopyConcurrency))
for _, part := range parts {
dstDiskName := diskName
if part.RebalancedDisk != "" {
Expand Down Expand Up @@ -1547,9 +1547,6 @@ func (b *Backuper) restoreEmbedded(ctx context.Context, backupName string, schem
if dataOnly {
settings = append(settings, "allow_non_empty_tables=1")
}
if b.cfg.ClickHouse.EmbeddedRestoreThreads > 0 {
settings = append(settings, fmt.Sprintf("restore_threads=%d", b.cfg.ClickHouse.EmbeddedRestoreThreads))
}
embeddedBackupLocation, err := b.getEmbeddedBackupLocation(ctx, backupName)
if err != nil {
return err
Expand Down
6 changes: 2 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type GeneralConfig struct {
UploadConcurrency uint8 `yaml:"upload_concurrency" envconfig:"UPLOAD_CONCURRENCY"`
UploadMaxBytesPerSecond uint64 `yaml:"upload_max_bytes_per_second" envconfig:"UPLOAD_MAX_BYTES_PER_SECOND"`
DownloadMaxBytesPerSecond uint64 `yaml:"download_max_bytes_per_second" envconfig:"DOWNLOAD_MAX_BYTES_PER_SECOND"`
ObjectDiskServerSizeCopyConcurrency uint8 `yaml:"object_disk_server_side_copy_concurrency" envconfig:"OBJECT_DISK_SERVER_SIDE_COPY_CONCURRENCY"`
ObjectDiskServerSideCopyConcurrency uint8 `yaml:"object_disk_server_side_copy_concurrency" envconfig:"OBJECT_DISK_SERVER_SIDE_COPY_CONCURRENCY"`
UseResumableState bool `yaml:"use_resumable_state" envconfig:"USE_RESUMABLE_STATE"`
RestoreSchemaOnCluster string `yaml:"restore_schema_on_cluster" envconfig:"RESTORE_SCHEMA_ON_CLUSTER"`
UploadByPart bool `yaml:"upload_by_part" envconfig:"UPLOAD_BY_PART"`
Expand Down Expand Up @@ -217,8 +217,6 @@ type ClickHouseConfig struct {
FreezeByPartWhere string `yaml:"freeze_by_part_where" envconfig:"CLICKHOUSE_FREEZE_BY_PART_WHERE"`
UseEmbeddedBackupRestore bool `yaml:"use_embedded_backup_restore" envconfig:"CLICKHOUSE_USE_EMBEDDED_BACKUP_RESTORE"`
EmbeddedBackupDisk string `yaml:"embedded_backup_disk" envconfig:"CLICKHOUSE_EMBEDDED_BACKUP_DISK"`
EmbeddedBackupThreads uint8 `yaml:"embedded_backup_threads" envconfig:"CLICKHOUSE_EMBEDDED_BACKUP_THREADS"`
EmbeddedRestoreThreads uint8 `yaml:"embedded_restore_threads" envconfig:"CLICKHOUSE_EMBEDDED_RESTORE_THREADS"`
BackupMutations bool `yaml:"backup_mutations" envconfig:"CLICKHOUSE_BACKUP_MUTATIONS"`
RestoreAsAttach bool `yaml:"restore_as_attach" envconfig:"CLICKHOUSE_RESTORE_AS_ATTACH"`
CheckPartsColumns bool `yaml:"check_parts_columns" envconfig:"CLICKHOUSE_CHECK_PARTS_COLUMNS"`
Expand Down Expand Up @@ -517,7 +515,7 @@ func DefaultConfig() *Config {
LogLevel: "info",
UploadConcurrency: uploadConcurrency,
DownloadConcurrency: downloadConcurrency,
ObjectDiskServerSizeCopyConcurrency: 32,
ObjectDiskServerSideCopyConcurrency: 32,
RestoreSchemaOnCluster: "",
UploadByPart: true,
DownloadByPart: true,
Expand Down

0 comments on commit 4a1b8af

Please sign in to comment.