branch-2.1: [fix](restore) Remove dynamic_partition.storage_policy property #48134 (#48160)

Cherry-picked from #48134

Co-authored-by: walter <maochuan@selectdb.com>
This commit is contained in:
github-actions[bot]
2025-02-21 17:37:37 +08:00
committed by GitHub
parent a3753c7edb
commit 0fe6c17ce2
4 changed files with 12 additions and 2 deletions

View File

@ -182,6 +182,10 @@ public class DynamicPartitionProperty {
return storagePolicy;
}
public void clearStoragePolicy() {
storagePolicy = "";
}
public String getStorageMedium() {
return storageMedium;
}

View File

@ -2214,13 +2214,17 @@ public class OlapTable extends Table implements MTMVRelatedTableIf {
return hasChanged;
}
public void ignoreInvaildPropertiesWhenSynced(Map<String, String> properties) {
public void ignoreInvalidPropertiesWhenSynced(Map<String, String> properties) {
// ignore colocate table
PropertyAnalyzer.analyzeColocate(properties);
// ignore storage policy
if (!PropertyAnalyzer.analyzeStoragePolicy(properties).isEmpty()) {
properties.remove(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY);
}
// ignore dynamic partition storage policy
if (properties.containsKey(DynamicPartitionProperty.STORAGE_POLICY)) {
properties.remove(DynamicPartitionProperty.STORAGE_POLICY);
}
}
public void checkChangeReplicaAllocation() throws DdlException {

View File

@ -404,6 +404,8 @@ public class TableProperty implements Writable {
properties.remove(PropertyAnalyzer.PROPERTIES_STORAGE_POLICY);
storagePolicy = "";
properties.remove(PropertyAnalyzer.PROPERTIES_COLOCATE_WITH);
properties.remove(DynamicPartitionProperty.STORAGE_POLICY);
dynamicPartitionProperty.clearStoragePolicy();
}
public TableProperty buildBinlogConfig() {

View File

@ -2599,7 +2599,7 @@ public class InternalCatalog implements CatalogIf<Database> {
olapTable.setIsBeingSynced(isBeingSynced);
if (isBeingSynced) {
// erase colocate table, storage policy
olapTable.ignoreInvaildPropertiesWhenSynced(properties);
olapTable.ignoreInvalidPropertiesWhenSynced(properties);
// remark auto bucket
if (isAutoBucket) {
olapTable.markAutoBucket();