Repository: Alluxio/alluxio (language: java)

Issue:
Writing to ozone failed without setting alluxio.underfs.version
**Alluxio Version:**
2.x

**Describe the bug**
Writing to ozone failed without setting alluxio.underfs.version.
```
WARN  ExtensionFactoryRegistry - No factory implementation supports the path o3fs://xxx.xxx/
WARN  UnderFileSystemFactoryRegistry - Versions [xxx] are supported for path o3fs://xxx.xxx/ but you have configured version: xxx
```
```
java.lang.IllegalArgumentException: No Under File System Factory found for: o3fs://xxx.xxx/
        at alluxio.underfs.UnderFileSystem$Factory.create(UnderFileSystem.java:95)
        at alluxio.underfs.AbstractUfsManager.getOrAdd(AbstractUfsManager.java:132)
        at alluxio.underfs.AbstractUfsManager.lambda$addMount$0(AbstractUfsManager.java:183)
        at alluxio.underfs.UfsManager$UfsClient.acquireUfsResource(UfsManager.java:61)
        at alluxio.worker.grpc.UfsFileWriteHandler.createUfsFile(UfsFileWriteHandler.java:155)
        at alluxio.worker.grpc.UfsFileWriteHandler.writeBuf(UfsFileWriteHandler.java:139)
        at alluxio.worker.grpc.UfsFileWriteHandler.writeBuf(UfsFileWriteHandler.java:49)
        at alluxio.worker.grpc.AbstractWriteHandler.writeData(AbstractWriteHandler.java:281)
        at alluxio.worker.grpc.AbstractWriteHandler.lambda$writeDataMessage$1(AbstractWriteHandler.java:179)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at alluxio.worker.grpc.GrpcExecutors$ImpersonateThreadPoolExecutor.lambda$execute$0(GrpcExecutors.java:159)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
```

**To Reproduce**
1. Start a cluster without setting alluxio.underfs.version;
2. Add a mount point for an ozone bucket without setting alluxio.underfs.version;
3. Upload a file to the ozone bucket.

**Expected behavior**
Can write files.

**Are you planning to fix it**
Yes. 



Discussion / hints:

Fix patch:
diff --git a/core/common/src/main/java/alluxio/conf/Configuration.java b/core/common/src/main/java/alluxio/conf/Configuration.java
index 1561025eeb4d..76a7ff98bac0 100644
--- a/core/common/src/main/java/alluxio/conf/Configuration.java
+++ b/core/common/src/main/java/alluxio/conf/Configuration.java
@@ -481,6 +481,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();
@@ -493,6 +494,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);


Test patch: