diff --git a/ChangeLog.md b/ChangeLog.md index 004067c9..242a2fa3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +# v2.4.15 +BUG FIXES +- fix `create` and `restore` command for ReplicatedMergeTree tables with `frozen_metadata.txt` parsing + # v2.4.14 IMPROVEMENTS - refactoring `semaphore.NewWeighted()` to `errgroup.SetLimit()` diff --git a/pkg/backup/create.go b/pkg/backup/create.go index 7ef2570d..6b7fe685 100644 --- a/pkg/backup/create.go +++ b/pkg/backup/create.go @@ -646,6 +646,9 @@ func (b *Backuper) uploadObjectDiskParts(ctx context.Context, backupName, backup if fInfo.IsDir() { return nil } + if fInfo.Name() == "frozen_metadata.txt" { + return nil + } objPartFileMeta, err := object_disk.ReadMetadataFromFile(fPath) if err != nil { return err diff --git a/pkg/backup/restore.go b/pkg/backup/restore.go index b1967037..2f52ebd4 100644 --- a/pkg/backup/restore.go +++ b/pkg/backup/restore.go @@ -854,6 +854,9 @@ func (b *Backuper) downloadObjectDiskParts(ctx context.Context, backupName strin if fInfo.IsDir() { return nil } + if fInfo.Name() == "frozen_metadata.txt" { + return nil + } objMeta, err := object_disk.ReadMetadataFromFile(fPath) if err != nil { return err diff --git a/test/integration/dynamic_settings.sh b/test/integration/dynamic_settings.sh index 57b4600c..bfedf4c5 100644 --- a/test/integration/dynamic_settings.sh +++ b/test/integration/dynamic_settings.sh @@ -222,12 +222,16 @@ cat < /etc/clickhouse-server/config.d/backup_storage_configuration_s3.xml backups_s3 /var/lib/clickhouse/backups_embedded/ + +EOT + +cat < /etc/clickhouse-server/config.d/zero_copy_replication.xml + 1 - + EOT - fi # s3_plain and azure backup configuration @@ -372,4 +376,4 @@ cat < /etc/clickhouse-server/config.d/replicated_user_directories.xml EOT -fi \ No newline at end of file +fi diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index b387a635..f8e6555a 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -2208,31 +2208,34 @@ func generateTestDataWithDifferentStoragePolicy(remoteStorageType string, testDa //s3 disks support after 21.8 if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "21.8") >= 0 && remoteStorageType == "S3" { testDataWithStoragePolicy.Name = "test_s3" - testDataWithStoragePolicy.Schema = "(id UInt64) Engine=MergeTree ORDER BY id SETTINGS storage_policy = 's3_only'" + testDataWithStoragePolicy.Schema = "(id UInt64) Engine=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{database}/{table}','{replica}') ORDER BY id SETTINGS storage_policy = 's3_only'" addTestDataIfNotExists() } //encrypted disks support after 21.10 if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "21.10") >= 0 { testDataWithStoragePolicy.Name = "test_hdd3_encrypted" - testDataWithStoragePolicy.Schema = "(id UInt64) Engine=MergeTree ORDER BY id SETTINGS storage_policy = 'hdd3_only_encrypted'" + testDataWithStoragePolicy.Schema = "(id UInt64) Engine=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{database}/{table}','{replica}') ORDER BY id SETTINGS storage_policy = 'hdd3_only_encrypted'" addTestDataIfNotExists() } //encrypted s3 disks support after 21.12 if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "21.12") >= 0 && remoteStorageType == "S3" { testDataWithStoragePolicy.Name = "test_s3_encrypted" testDataWithStoragePolicy.Schema = "(id UInt64) Engine=MergeTree ORDER BY id SETTINGS storage_policy = 's3_only_encrypted'" + if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "23.3") >= 0 { + testDataWithStoragePolicy.Schema = "(id UInt64) Engine=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{database}/{table}','{replica}') ORDER BY id SETTINGS storage_policy = 's3_only_encrypted'" + } addTestDataIfNotExists() } //gcs over s3 support added in 22.6 if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "22.6") >= 0 && remoteStorageType == "GCS" && os.Getenv("QA_GCS_OVER_S3_BUCKET") != "" { testDataWithStoragePolicy.Name = "test_gcs" - testDataWithStoragePolicy.Schema = "(id UInt64) Engine=MergeTree ORDER BY id SETTINGS storage_policy = 'gcs_only'" + testDataWithStoragePolicy.Schema = "(id UInt64) Engine=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{database}/{table}','{replica}') ORDER BY id SETTINGS storage_policy = 'gcs_only'" addTestDataIfNotExists() } //check azure_blob_storage only in 23.3+ (added in 22.1) if compareVersion(os.Getenv("CLICKHOUSE_VERSION"), "23.3") >= 0 && remoteStorageType == "AZBLOB" { testDataWithStoragePolicy.Name = "test_azure" - testDataWithStoragePolicy.Schema = "(id UInt64) Engine=MergeTree ORDER BY id SETTINGS storage_policy = 'azure_only'" + testDataWithStoragePolicy.Schema = "(id UInt64) Engine=ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{database}/{table}','{replica}') ORDER BY id SETTINGS storage_policy = 'azure_only'" addTestDataIfNotExists() } }