diff --git a/fe/src/com/baidu/palo/catalog/Catalog.java b/fe/src/com/baidu/palo/catalog/Catalog.java index 2e21e247f8546d..e2cd3acd103f42 100644 --- a/fe/src/com/baidu/palo/catalog/Catalog.java +++ b/fe/src/com/baidu/palo/catalog/Catalog.java @@ -4946,10 +4946,13 @@ public long loadCluster(DataInputStream dis, long checksum) throws IOException, checksum ^= cluster.getId(); // BE is in default_cluster when added , therefore it is possible that the BE - // in default_clsuter are not the latest because cluster cant't be updated when - // loadCluster is after loadBackend. + // in default_cluster are not the latest because cluster cant't be updated when + // loadCluster is after loadBackend. Because of forgeting to remove BE's id in + // cluster when drop BE or decommission in latest versions, need to update cluster's + // BE. List latestBackendIds = systemInfo.getClusterBackendIds(cluster.getName()); - if (cluster.getName().equalsIgnoreCase(SystemInfoService.DEFAULT_CLUSTER)) { + if (cluster.getName().equalsIgnoreCase(SystemInfoService.DEFAULT_CLUSTER) + || Catalog.getCurrentCatalogJournalVersion() <= FeMetaVersion.VERSION_34) { cluster.setBackendIdList(latestBackendIds); } else { // The cluster has the same number of be as systeminfo recorded diff --git a/fe/src/com/baidu/palo/common/FeConstants.java b/fe/src/com/baidu/palo/common/FeConstants.java index a1bc669776c7c4..1ed0fd520cf0ee 100644 --- a/fe/src/com/baidu/palo/common/FeConstants.java +++ b/fe/src/com/baidu/palo/common/FeConstants.java @@ -38,5 +38,5 @@ public class FeConstants { // general model // Current meta data version. Use this version to write journals and image - public static int meta_version = FeMetaVersion.VERSION_34; + public static int meta_version = FeMetaVersion.VERSION_35; } diff --git a/fe/src/com/baidu/palo/common/FeMetaVersion.java b/fe/src/com/baidu/palo/common/FeMetaVersion.java index 19379133b859a0..4a7a86357edc46 100644 --- a/fe/src/com/baidu/palo/common/FeMetaVersion.java +++ b/fe/src/com/baidu/palo/common/FeMetaVersion.java @@ -68,4 +68,9 @@ public final class FeMetaVersion { // persist LoadJob's execMemLimit public static final int VERSION_34 = 34; + + // update the BE in cluster, because of forgeting + // to remove backend in cluster when drop backend or + // decommission in latest versions. + public static final int VERSION_35= 35; }