diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java index e00bf4b28ef1b3..5f715b46271c3a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java @@ -23,6 +23,7 @@ import org.apache.doris.cloud.catalog.CloudPartition; import org.apache.doris.common.Config; import org.apache.doris.common.FeConstants; +import org.apache.doris.common.FeMetaVersion; import org.apache.doris.common.io.Text; import org.apache.doris.rpc.RpcException; @@ -350,6 +351,14 @@ public boolean visualiseShadowIndex(long shadowIndexId, boolean isBaseIndex) { @Deprecated public static Partition read(DataInput in) throws IOException { + if (Env.getCurrentEnvJournalVersion() <= FeMetaVersion.VERSION_129) { + // For meta <= 2.1, we should not call EnvFactory.getInstance().createPartition(), because + // it will create a new CloudPartition in cloud mode, which is not expected in meta <= 2.1. + // This case happens when we restore old doris <= 2.1 to a new cloud doris. + Partition partition = new Partition(); + partition.readFields(in); + return partition; + } Partition partition = EnvFactory.getInstance().createPartition(); partition.readFields(in); return partition; diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionInfo.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionInfo.java index 1c99344beada26..793bb091517d66 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionInfo.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionInfo.java @@ -466,13 +466,17 @@ public void readFields(DataInput in) throws IOException { } idToInMemory.put(partitionId, in.readBoolean()); - if (Config.isCloudMode()) { - // HACK: the origin implementation of the cloud mode has code likes: - // - // idToPersistent.put(partitionId, in.readBoolean()); - // - // keep the compatibility here. - in.readBoolean(); + // For meta <= 2.1, we don't need to do this. Or else if we backup from old doris <= 2.1 + // and restore to a new cloud doris, it will fail at read BackupMeta. + if (Env.getCurrentEnvJournalVersion() > FeMetaVersion.VERSION_129) { + if (Config.isCloudMode()) { + // HACK: the origin implementation of the cloud mode has code likes: + // + // idToPersistent.put(partitionId, in.readBoolean()); + // + // keep the compatibility here. + in.readBoolean(); + } } } if (Env.getCurrentEnvJournalVersion() >= FeMetaVersion.VERSION_125) { diff --git a/regression-test/suites/restore_p0/test_duplicate_validate_restore.groovy b/regression-test/suites/restore_p0/test_duplicate_validate_restore.groovy index c30a007ec5196d..e8d1ec516f7bdf 100644 --- a/regression-test/suites/restore_p0/test_duplicate_validate_restore.groovy +++ b/regression-test/suites/restore_p0/test_duplicate_validate_restore.groovy @@ -83,6 +83,6 @@ suite("test_duplicate_validate_restore", "validate_restore") { } runDuplicateValidateRestore("3.0") - //runDuplicateValidateRestore("2.1") + runDuplicateValidateRestore("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore.groovy b/regression-test/suites/restore_p0/test_validate_restore.groovy index 1f3c6d252481b0..5f441aa2cd94c3 100644 --- a/regression-test/suites/restore_p0/test_validate_restore.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore.groovy @@ -56,5 +56,5 @@ suite("test_validate_validate_restore", "validate_restore") { } runValidateRestore("3.0") - //runValidateRestore("2.1") + runValidateRestore("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_alias.groovy b/regression-test/suites/restore_p0/test_validate_restore_alias.groovy index a6b55ccad9275e..c48b65a0ecf6d6 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_alias.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_alias.groovy @@ -78,5 +78,5 @@ suite("test_validate_restore_alias", "validate_restore") { } runValidateRestoreAlias("3.0") - //runValidateRestoreAlias("2.1") + runValidateRestoreAlias("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_backup_temp_partition.groovy b/regression-test/suites/restore_p0/test_validate_restore_backup_temp_partition.groovy index 4b003e67e0d46c..6faa623c6ff950 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_backup_temp_partition.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_backup_temp_partition.groovy @@ -59,5 +59,5 @@ suite("test_validate_restore_backup_temp_partition", "validate_restore") { } runValidateRestoreBackupTempPartition("3.0") - //runValidateRestoreBackupTempPartition("2.1") + runValidateRestoreBackupTempPartition("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_bloom_filter.groovy b/regression-test/suites/restore_p0/test_validate_restore_bloom_filter.groovy index b16392ac93c195..75a7f0f132d7bf 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_bloom_filter.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_bloom_filter.groovy @@ -64,6 +64,6 @@ suite("test_validate_restore_bloom_filter", "validate_restore") { } runValidateRestoreBloomFilter("3.0") - //runValidateRestoreBloomFilter("2.1") + runValidateRestoreBloomFilter("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_db.groovy b/regression-test/suites/restore_p0/test_validate_restore_db.groovy index d7ee39b2dce8b0..44481c3a317613 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_db.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_db.groovy @@ -65,5 +65,5 @@ suite("test_validate_restore_db", "validate_restore") { } runValidateRestoreDb("3.0") - //runValidateRestoreDb("2.1") + runValidateRestoreDb("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_diff_repo_same_snapshot.groovy b/regression-test/suites/restore_p0/test_validate_restore_diff_repo_same_snapshot.groovy index c7e765bdacb2b7..7ad56313f32e59 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_diff_repo_same_snapshot.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_diff_repo_same_snapshot.groovy @@ -83,5 +83,5 @@ suite("test_validate_restore_diff_repo_same_snapshot", "validate_restore") { } runValidateRestoreDiffRepoSameSnapshot("3.0") - //runValidateRestoreDiffRepoSameSnapshot("2.1") + runValidateRestoreDiffRepoSameSnapshot("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_dup_without_default_keys.groovy b/regression-test/suites/restore_p0/test_validate_restore_dup_without_default_keys.groovy index 7050adae886880..fff03a1a91ccee 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_dup_without_default_keys.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_dup_without_default_keys.groovy @@ -65,6 +65,6 @@ suite("test_validate_restore_dup_without_default_keys", "validate_restore") { } runValidateRestoreDupWithoutDefaultKeys("3.0") - //runValidateRestoreDupWithoutDefaultKeys("2.1") + runValidateRestoreDupWithoutDefaultKeys("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_dynamic_partition_reserve_true.groovy b/regression-test/suites/restore_p0/test_validate_restore_dynamic_partition_reserve_true.groovy index 020793cbd583cf..ec728adc6da5b8 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_dynamic_partition_reserve_true.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_dynamic_partition_reserve_true.groovy @@ -65,6 +65,6 @@ suite("test_validate_restore_dynamic_partition_reserve_true", "validate_restore" } runValidateRestoreDynamicPartitionReserveTrue("3.0") - //runValidateRestoreDynamicPartitionReserveTrue("2.1") + runValidateRestoreDynamicPartitionReserveTrue("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_exclude.groovy b/regression-test/suites/restore_p0/test_validate_restore_exclude.groovy index b6ed6ba3698bed..bb29e393906d59 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_exclude.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_exclude.groovy @@ -89,7 +89,7 @@ suite("test_validate_restore_exclude", "validate_restore") { } runValidateRestoreExclude("3.0") - //runValidateRestoreExclude("2.1") + runValidateRestoreExclude("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy b/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy index 1921aeebbf5ce1..79c68dc41bfee1 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_inverted_idx.groovy @@ -158,7 +158,7 @@ suite("test_validate_restore_inverted_idx", "validate_restore") { } runValidateRestoreInvertedIdx("3.0") - //runValidateRestoreInvertedIdx("2.1") + runValidateRestoreInvertedIdx("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_inverted_index.groovy b/regression-test/suites/restore_p0/test_validate_restore_inverted_index.groovy index 0496924adefb39..d36a69862057b3 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_inverted_index.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_inverted_index.groovy @@ -71,6 +71,6 @@ suite("test_validate_restore_inverted_index", "validate_restore") { } runValidateRestoreInvertedIndex("3.0") - //runValidateRestoreInvertedIndex("2.1") + runValidateRestoreInvertedIndex("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_mix_exists_and_new_table.groovy b/regression-test/suites/restore_p0/test_validate_restore_mix_exists_and_new_table.groovy index 4699419f6f402f..47612ce29a7a3d 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_mix_exists_and_new_table.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_mix_exists_and_new_table.groovy @@ -90,7 +90,7 @@ suite("test_validate_restore_mix_exists_and_new_table", "validate_restore") { } runValidateRestoreMixExistsAndNewTable("3.0") - //runValidateRestoreMixExistsAndNewTable("2.1") + runValidateRestoreMixExistsAndNewTable("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_mtmv.groovy b/regression-test/suites/restore_p0/test_validate_restore_mtmv.groovy index 89eff8394b3f4d..1fe971683c3203 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_mtmv.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_mtmv.groovy @@ -65,7 +65,7 @@ suite("test_validate_restore_mtmv", "validate_restore") { } runValidateRestoreMtmv("3.0") - //runValidateRestoreMtmv("2.1") + runValidateRestoreMtmv("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_mv.groovy b/regression-test/suites/restore_p0/test_validate_restore_mv.groovy index de8e1519e5db6f..6be63dd072b477 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_mv.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_mv.groovy @@ -75,7 +75,7 @@ suite("test_validate_restore_mv", "validate_restore") { } runValidateRestoreMv("3.0") - //runValidateRestoreMv("2.1") + runValidateRestoreMv("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_ngram_bloom_filter.groovy b/regression-test/suites/restore_p0/test_validate_restore_ngram_bloom_filter.groovy index ddea73d431cc28..d9aa32500d9d7a 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_ngram_bloom_filter.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_ngram_bloom_filter.groovy @@ -149,6 +149,6 @@ suite("test_validate_restore_ngram_bloom_filter", "validate_restore") { } runValidateRestoreNgramBloomFilter("3.0") - //runValidateRestoreNgramBloomFilter("2.1") + runValidateRestoreNgramBloomFilter("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_partition.groovy b/regression-test/suites/restore_p0/test_validate_restore_partition.groovy index 7d6cbd582d26ec..e062b980862c13 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_partition.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_partition.groovy @@ -75,6 +75,6 @@ suite("test_validate_restore_partition", "validate_restore") { } runValidateRestorePartition("3.0") - //runValidateRestorePartition("2.1") + runValidateRestorePartition("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_reserve_dynamic_partition_false.groovy b/regression-test/suites/restore_p0/test_validate_restore_reserve_dynamic_partition_false.groovy index b827960315d9c7..b4449337e2ece7 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_reserve_dynamic_partition_false.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_reserve_dynamic_partition_false.groovy @@ -61,6 +61,6 @@ suite("test_validate_restore_reserve_dynamic_partition_false", "validate_restore } runValidateRestoreReserveDynamicPartitionFalse("3.0") - //runValidateRestoreReserveDynamicPartitionFalse("2.1") + runValidateRestoreReserveDynamicPartitionFalse("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_table_auto_bucket.groovy b/regression-test/suites/restore_p0/test_validate_restore_table_auto_bucket.groovy index a9878f9a2c72ae..ab9e3d103cda96 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_table_auto_bucket.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_table_auto_bucket.groovy @@ -61,6 +61,6 @@ suite("test_validate_restore_table_auto_bucket", "validate_restore") { } runValidateRestoreTableAutoBucket("3.0") - //runValidateRestoreTableAutoBucket("2.1") + runValidateRestoreTableAutoBucket("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_to_new_table.groovy b/regression-test/suites/restore_p0/test_validate_restore_to_new_table.groovy index a4caf7c0071585..bf3f3ef01f8e75 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_to_new_table.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_to_new_table.groovy @@ -79,5 +79,5 @@ suite("test_validate_restore_to_new_table", "validate_restore") { } runValidateRestoreToNewTable("3.0") - //runValidateRestoreToNewTable("2.1") + runValidateRestoreToNewTable("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_with_two_phase_fetch_opt.groovy b/regression-test/suites/restore_p0/test_validate_restore_with_two_phase_fetch_opt.groovy index 378c252e6aff90..e2e73d878f9017 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_with_two_phase_fetch_opt.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_with_two_phase_fetch_opt.groovy @@ -58,6 +58,6 @@ suite("test_validate_restore_with_two_phase_fetch_opt", "validate_restore") { } runValidateRestoreWithTwoPhaseFetchOpt("3.0") - //runValidateRestoreWithTwoPhaseFetchOpt("2.1") + runValidateRestoreWithTwoPhaseFetchOpt("2.1") } diff --git a/regression-test/suites/restore_p0/test_validate_restore_with_view.groovy b/regression-test/suites/restore_p0/test_validate_restore_with_view.groovy index bf016938a2639f..4b2340d35c7009 100644 --- a/regression-test/suites/restore_p0/test_validate_restore_with_view.groovy +++ b/regression-test/suites/restore_p0/test_validate_restore_with_view.groovy @@ -108,5 +108,5 @@ suite("test_validate_restore_with_view", "validate_restore") { } runValidateRestoreWithView("3.0") - //runValidateRestoreWithView("2.1") + runValidateRestoreWithView("2.1") }