update backend in cluster because of forgeting to remove backend' id when drop backend or decommission in latest version (#76)

* update backend in cluster because of forgeting to remove backend' id when drop backend or decommission in latest version

* select wrong rollup

* update backend in cluster because of forgeting to remove backend' id when drop backend or decommission in latest version
This commit is contained in:
chenhao7253886
2017-09-05 21:28:51 +08:00
committed by GitHub
parent 064f253177
commit 58f0bf64a1
3 changed files with 12 additions and 4 deletions

View File

@ -4946,10 +4946,13 @@ public class Catalog {
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<Long> 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

View File

@ -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;
}

View File

@ -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;
}