Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persist decommission type and load check lost cluster property #36

Merged
merged 1 commit into from
Aug 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion fe/src/com/baidu/palo/alter/DecommissionBackendJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ public synchronized boolean sendTasks() {
final Map<String, Integer> clusterAvailBeMap = Maps.newHashMap();
for (String cluster : clusterBackendsMap.keySet()) {
final Map<Long, Backend> backends = clusterBackendsMap.get(cluster);
int aliveBackendNum = clusterInfo.getClusterBackends(cluster, true).size();
final List<Backend> 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
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions fe/src/com/baidu/palo/analysis/LoadStmt.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static void checkProperties(Map<String, String> 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<String, String> entry : properties.entrySet()) {
if (!propertySet.contains(entry.getKey())) {
Expand Down
2 changes: 1 addition & 1 deletion fe/src/com/baidu/palo/common/FeConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 3 additions & 0 deletions fe/src/com/baidu/palo/common/FeMetaVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}