huhaiyang created HDFS-14870: -------------------------------- Summary: [SBN read] Key: HDFS-14870 URL: https://issues.apache.org/jira/browse/HDFS-14870 Project: Hadoop HDFS Issue Type: Improvement Components: hdfs Affects Versions: 3.2.1, 2.10.0, 3.3.0 Reporter: huhaiyang
Client Settings agent refers to ObserverReadProxyProvider class, read the RPC request will be forwarded to the ONN, but involves the need to modify the file, the request will be processed twice, cause the request time is too long; When ONN received from the client to read a file, will call FSNamesystem getBlockLocations method to get the list of file information, and the current atime decided the current file needs to be updated (dfs.namenode.accesstime.precision, HDFS file access time is accurate, The default value is 1 hour). The ONN node does not currently support write operations. This logic throws an alternate exception, and the client retries the RPC request and forwards it to ANN for execution. As a result, the current file getBlockLocations method will be called twice, lengthening the entire RPC request. FSNamesystem#getBlockLocations LocatedBlocks getBlockLocations(String clientMachine, String srcArg, long offset, long length) throws IOException { final String operationName = "open"; checkOperation(OperationCategory.READ); GetBlockLocationsResult res = null; final FSPermissionChecker pc = getPermissionChecker(); readLock(); try { checkOperation(OperationCategory.READ); res = FSDirStatAndListingOp.getBlockLocations( dir, pc, srcArg, offset, length, true); ... if (!isInSafeMode() && res.updateAccessTime()) { String src = srcArg; checkOperation(OperationCategory.WRITE); ... } -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org