Skip to content

Commit b1b23ac

Browse files
committed
final changes to fix backup for azblob disk behavior when storage_account_url contains container as first part in hostname, fix #1153
Signed-off-by: Slach <[email protected]>
1 parent 207af82 commit b1b23ac

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

ChangeLog.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
# v2.6.21
2+
BUG FIXES
3+
- final changes to fix backup for azblob disk behavior when `storage_account_url` contains container as first part in hostname, fix [1153](https://github.com/Altinity/clickhouse-backup/issues/1153)
4+
15
# v2.6.20
2-
- fix backup for azblob disk behavior when `storage_account_url` contains container as first part in hostname
6+
BUG FIXES
7+
- fix backup for azblob disk behavior when `storage_account_url` contains container as first part in hostname, fix [1153](https://github.com/Altinity/clickhouse-backup/issues/1153)
38

49
# v2.6.19
510
BUG FIXES
611
- fix `clickhouse_backup_number_backups_remote` and `last_backup_size_remote` metrics behavior in `watch` command, fix [1152](https://github.com/Altinity/clickhouse-backup/issues/1152)
712
- fix empty `path` and non-empty `object_disk_path` config parameters, allows unexpected deletion backup object disk data, fix [859](https://github.com/Altinity/clickhouse-backup/issues/859)
813
- reproduce behavior `<metadata_path>` parameter in clickhouse `<storage_configuration>` don't contain trailing slash, restore make hardlinks to wrong directory, look details in https://github.com/Altinity/clickhouse-backup/issues/859#issuecomment-2896880448, https://github.com/ClickHouse/ClickHouse/issues/80647
9-
- fix backup for azblob disk behavior when `storage_account_url` contains container as first part in hostname
14+
- fix backup for azblob disk behavior when `storage_account_url` contains container as first part in hostname, fix [1153](https://github.com/Altinity/clickhouse-backup/issues/1153)
1015
- fix wrong unescape special characters in table create query, fix [1151](https://github.com/Altinity/clickhouse-backup/issues/1151), affected aversions from 2.6.6 to 2.6.18, backups which created in these versions which contains `\` in create table definition, requires manual replacing `\` to `\\` for properly restore.
1116

1217
# v2.6.18

pkg/storage/azblob.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,12 @@ func (a *AzureBlob) WalkAbsolute(ctx context.Context, prefix string, recursive b
324324
func (a *AzureBlob) CopyObject(ctx context.Context, srcSize int64, srcBucket, srcKey, dstKey string) (int64, error) {
325325
dstKey = path.Join(a.Config.ObjectDiskPath, dstKey)
326326
a.logf("AZBLOB->CopyObject %s/%s -> %s/%s", srcBucket, srcKey, a.Config.Container, dstKey)
327-
srcURLString := fmt.Sprintf("%s://%s.%s/%s/%s", a.Config.EndpointSchema, a.Config.AccountName, a.Config.EndpointSuffix, srcBucket, srcKey)
327+
//ugly hack ;(
328+
endpoint := a.Config.EndpointSuffix
329+
if strings.HasSuffix(endpoint, "core.windows.net") || !strings.HasPrefix(endpoint, "blob.") {
330+
endpoint = "blob." + endpoint
331+
}
332+
srcURLString := fmt.Sprintf("%s://%s.%s/%s/%s", a.Config.EndpointSchema, a.Config.AccountName, endpoint, strings.Trim(srcBucket, "/"), strings.Trim(srcKey, "/"))
328333
srcURL, err := url.Parse(srcURLString)
329334
if err != nil {
330335
return 0, err

0 commit comments

Comments
 (0)