Skip to content

Commit

Permalink
fix use_embedded_backup_restore: true behavior for azblob, fix #1031
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Oct 22, 2024
1 parent 5ff4648 commit e568996
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ IMPROVEMENTS
BUG FIXES
- fix `TestLongListRemote` for properly time measurement
- fix log_pointer handle from system.replicas during restore, fix [967](https://github.com/Altinity/clickhouse-backup/issues/967)
- fix `use_embedded_backup_restore: true` behavior for azblob, fix [1031](https://github.com/Altinity/clickhouse-backup/issues/1031)

# v2.6.2
BUG FIXES
- fix rare corner case, for system.disks query behavior fix[1007](https://github.com/Altinity/clickhouse-backup/issues/1007)
- fix rare corner case, for system.disks query behavior fix [1007](https://github.com/Altinity/clickhouse-backup/issues/1007)
- fix --partitions and --restore-database-mapping, --restore-table-mapping works together, fix [1018](https://github.com/Altinity/clickhouse-backup/issues/1018)
- fix wrong slices initialization for `shardFuncByName` (rare used function for backup different tables from different shards), fix [1019](https://github.com/Altinity/clickhouse-backup/pull/1019), thanks @cuishuang

Expand Down
9 changes: 7 additions & 2 deletions pkg/backup/backuper.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,13 @@ func (b *Backuper) buildEmbeddedLocationGCS() string {
func (b *Backuper) buildEmbeddedLocationAZBLOB() string {
azblobBackupURL := url.URL{}
azblobBackupURL.Scheme = b.cfg.AzureBlob.EndpointSchema
azblobBackupURL.Host = b.cfg.AzureBlob.EndpointSuffix
azblobBackupURL.Path = b.cfg.AzureBlob.AccountName
// https://github.com/Altinity/clickhouse-backup/issues/1031
if !strings.Contains(b.cfg.AzureBlob.EndpointSuffix, b.cfg.AzureBlob.AccountName) && b.cfg.AzureBlob.EndpointSuffix == "core.windows.net" {
azblobBackupURL.Host = b.cfg.AzureBlob.AccountName + "." + b.cfg.AzureBlob.EndpointSuffix
} else {
azblobBackupURL.Host = b.cfg.AzureBlob.EndpointSuffix
azblobBackupURL.Path = b.cfg.AzureBlob.AccountName
}
return fmt.Sprintf("DefaultEndpointsProtocol=%s;AccountName=%s;AccountKey=%s;BlobEndpoint=%s;", b.cfg.AzureBlob.EndpointSchema, b.cfg.AzureBlob.AccountName, b.cfg.AzureBlob.AccountKey, azblobBackupURL.String())
}

Expand Down

0 comments on commit e568996

Please sign in to comment.