@@ -1517,6 +1517,20 @@ func (b *Backuper) fixEmbeddedMetadataLocal(ctx context.Context, backupName stri
15171517 }
15181518 sqlMetadata .TotalSize = int64 (len (sqlQuery ))
15191519 sqlMetadata .StorageObjects [0 ].ObjectSize = sqlMetadata .TotalSize
1520+ //after object_disk.ReadMetadataFile, path is relative, need make it absolute again https://github.com/Altinity/clickhouse-backup/issues/1290
1521+ if sqlMetadata .StorageObjects [0 ].IsAbsolute {
1522+ dstConnection , ok := object_disk .DisksConnections .Load (b .cfg .ClickHouse .EmbeddedBackupDisk )
1523+ if ! ok {
1524+ return errors .WithStack (fmt .Errorf ("can't find %s in object_disk.DiskConnections" , b .cfg .ClickHouse .EmbeddedBackupDisk ))
1525+ }
1526+ if ! strings .HasPrefix (sqlMetadata .StorageObjects [0 ].ObjectPath , dstConnection .GetRemotePath ()) {
1527+ objPathParts := strings .Split (sqlMetadata .StorageObjects [0 ].ObjectPath , "/" )
1528+ // 25.10, full path for azblob we will write to container, so path will not contain /, https://github.com/Altinity/clickhouse-backup/issues/1290
1529+ if len (objPathParts ) >= 2 {
1530+ sqlMetadata .StorageObjects [0 ].ObjectPath = dstConnection .GetRemotePath () + "/" + strings .Join (objPathParts [len (objPathParts )- 2 :], "/" )
1531+ }
1532+ }
1533+ }
15201534 if err = object_disk .WriteMetadataToFile (sqlMetadata , filePath ); err != nil {
15211535 return errors .WithStack (err )
15221536 }
@@ -2077,7 +2091,7 @@ func (b *Backuper) downloadObjectDiskParts(ctx context.Context, backupName strin
20772091 if err != nil {
20782092 return err
20792093 }
2080- if objMeta .StorageObjectCount < 1 && ( objMeta .Version < object_disk . VersionRelativePath || objMeta . Version != object_disk .VersionFullObjectKey ) {
2094+ if objMeta .StorageObjectCount < 1 && objMeta .Version != object_disk .VersionInlineData {
20812095 return fmt .Errorf ("%s: invalid object_disk.Metadata: %#v" , fPath , objMeta )
20822096 }
20832097 needObjMetaRewrite := false
0 commit comments