ayushtkn commented on code in PR #5860:
URL: https://github.com/apache/hadoop/pull/5860#discussion_r1272175747


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -1928,9 +1928,14 @@ public BatchedEntries<OpenFileEntry> listOpenFiles(long 
prevId,
   @Override
   public void msync() throws IOException {
     rpcServer.checkOperation(NameNode.OperationCategory.READ, true);
-    Set<FederationNamespaceInfo> nss = namenodeResolver.getNamespaces();
+    // Only msync to nameservices with observer reads enabled.
+    Set<FederationNamespaceInfo> allNamespaces = 
namenodeResolver.getNamespaces();
     RemoteMethod method = new RemoteMethod("msync");
-    rpcClient.invokeConcurrent(nss, method);
+    Set<FederationNamespaceInfo> namespacesEligibleForObserverReads = 
allNamespaces
+        .stream()
+        .filter(ns -> 
rpcClient.isNamespaceObserverReadEligible(ns.getNameserviceId()))
+        .collect(Collectors.toSet());
+    rpcClient.invokeConcurrent(namespacesEligibleForObserverReads, method);

Review Comment:
   If the ```namespacesEligibleForObserverReads``` land up being 0, I think 
this would throw us an exception, there is check if you go inside
   ```
       if (locations.isEmpty()) {
         throw new IOException("No remote locations available");
       } 
   ```
   
   I think if there is no location we should just return here



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -264,7 +264,7 @@ public HdfsFileStatus create(String src, FsPermission 
masked,
       String clientName, EnumSetWritable<CreateFlag> flag,
       boolean createParent, short replication, long blockSize,
       CryptoProtocolVersion[] supportedVersions, String ecPolicyName,
-      String storagePolicy)
+      String storagePolicyName)

Review Comment:
   unrelated change, avoid



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to