diff --git a/fe/src/com/baidu/palo/alter/DecommissionBackendJob.java b/fe/src/com/baidu/palo/alter/DecommissionBackendJob.java index b8cb31abdf6e41..139ab7ce5d5bbd 100644 --- a/fe/src/com/baidu/palo/alter/DecommissionBackendJob.java +++ b/fe/src/com/baidu/palo/alter/DecommissionBackendJob.java @@ -159,7 +159,12 @@ public synchronized boolean sendTasks() { final Map clusterAvailBeMap = Maps.newHashMap(); for (String cluster : clusterBackendsMap.keySet()) { final Map backends = clusterBackendsMap.get(cluster); - int aliveBackendNum = clusterInfo.getClusterBackends(cluster, true).size(); + final List clusterAllLiveBackends = clusterInfo.getClusterBackends(cluster, true); + if (clusterAllLiveBackends == null) { + LOG.warn("does not belong to any cluster."); + return true; + } + int aliveBackendNum = clusterAllLiveBackends.size(); int availableBackendNum = aliveBackendNum - backends.keySet().size(); if (availableBackendNum <= 0) { // do nothing, just log @@ -562,6 +567,10 @@ public void readFields(DataInput in) throws IOException { } clusterBackendsMap.put(SystemInfoService.DEFAULT_CLUSTER, backends); } + + if (Catalog.getCurrentCatalogJournalVersion() >= FeMetaVersion.VERSION_33) { + decomissionType = DecomissionType.valueOf(Text.readString(in)); + } } @Override @@ -577,6 +586,7 @@ public void write(DataOutput out) throws IOException { out.writeLong(id); } } + Text.writeString(out, decomissionType.toString()); } public static DecommissionBackendJob read(DataInput in) throws IOException { diff --git a/fe/src/com/baidu/palo/analysis/LoadStmt.java b/fe/src/com/baidu/palo/analysis/LoadStmt.java index a361d44db2d7f7..2e5781a92d803f 100644 --- a/fe/src/com/baidu/palo/analysis/LoadStmt.java +++ b/fe/src/com/baidu/palo/analysis/LoadStmt.java @@ -127,6 +127,7 @@ public static void checkProperties(Map properties) throws DdlExc propertySet.add(LoadStmt.TIMEOUT_PROPERTY); propertySet.add(LoadStmt.MAX_FILTER_RATIO_PROPERTY); propertySet.add(LoadStmt.LOAD_DELETE_FLAG_PROPERTY); + propertySet.add(LoadStmt.CLUSTER_PROPERTY); for (Entry entry : properties.entrySet()) { if (!propertySet.contains(entry.getKey())) { diff --git a/fe/src/com/baidu/palo/common/FeConstants.java b/fe/src/com/baidu/palo/common/FeConstants.java index c9f0e230e2934a..1f36e71137ab01 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_32; + public static int meta_version = FeMetaVersion.VERSION_33; } diff --git a/fe/src/com/baidu/palo/common/FeMetaVersion.java b/fe/src/com/baidu/palo/common/FeMetaVersion.java index 6f190548bc887b..c52603475849d3 100644 --- a/fe/src/com/baidu/palo/common/FeMetaVersion.java +++ b/fe/src/com/baidu/palo/common/FeMetaVersion.java @@ -62,4 +62,7 @@ public final class FeMetaVersion { // Palo3.2 public static final int VERSION_32 = 32; + + // persist decommission type + public static final int VERSION_33 = 33; }