Skip to content

Commit

Permalink
Check cluster ufs version in getClusterConf
Browse files Browse the repository at this point in the history
### What changes are proposed in this pull request?

Check cluster ufs version in getClusterConf.

### Why are the changes needed?

Fix Alluxio#18221.

			pr-link: Alluxio#18222
			change-id: cid-2c67758e30cac31a84f41d47b50c0ed958c88ffb
  • Loading branch information
Haoning-Sun authored and codings-dan committed Dec 21, 2023
1 parent e45b1e2 commit 2ac77f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/common/src/main/java/alluxio/conf/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ public static GetConfigurationPResponse loadConfiguration(InetSocketAddress addr
public static InstancedConfiguration getClusterConf(GetConfigurationPResponse response,
AlluxioConfiguration conf, Scope scope) {
String clientVersion = conf.getString(PropertyKey.VERSION);
String clientUfsVersion = conf.getString(PropertyKey.UNDERFS_VERSION);
LOG.debug("Alluxio {} (version {}) is trying to load cluster level configurations",
scope, clientVersion);
List<alluxio.grpc.ConfigProperty> clusterConfig = response.getClusterConfigsList();
Expand All @@ -615,6 +616,11 @@ public static InstancedConfiguration getClusterConf(GetConfigurationPResponse re
scope, clientVersion, clusterVersion);
clusterProps.remove(PropertyKey.VERSION);
}
// Check ufs version. Avoid adding it to user properties if the two versions are the same.
String clusterUfsVersion = clusterProps.get(PropertyKey.UNDERFS_VERSION).toString();
if (clientUfsVersion.equals(clusterUfsVersion)) {
clusterProps.remove(PropertyKey.UNDERFS_VERSION);
}
// Merge conf returned by master as the cluster default into conf object
AlluxioProperties props = conf.copyProperties();
props.merge(clusterProps, Source.CLUSTER_DEFAULT);
Expand Down

0 comments on commit 2ac77f8

Please sign in to comment.