You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Hui Fei (Jira)" <ji...@apache.org> on 2022/02/09 02:13:00 UTC
[jira] [Resolved] (HDFS-16406) DataNode metric ReadsFromLocalClient does not count short-circuit reads
[ https://issues.apache.org/jira/browse/HDFS-16406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hui Fei resolved HDFS-16406.
----------------------------
Fix Version/s: 3.4.0
Resolution: Fixed
> DataNode metric ReadsFromLocalClient does not count short-circuit reads
> -----------------------------------------------------------------------
>
> Key: HDFS-16406
> URL: https://issues.apache.org/jira/browse/HDFS-16406
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: secfree
> Assignee: secfree
> Priority: Minor
> Labels: metrics, pull-request-available
> Fix For: 3.4.0
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> The following test case failed.
> {code}
> @Test
> public void testNodeLocalMetrics() throws Exception {
> Assume.assumeTrue(null == DomainSocket.getLoadingFailureReason());
> Configuration conf = new HdfsConfiguration();
> conf.setBoolean(HdfsClientConfigKeys.Read.ShortCircuit.KEY, true);
> TemporarySocketDirectory sockDir = new TemporarySocketDirectory();
> DomainSocket.disableBindPathValidation();
> conf.set(DFSConfigKeys.DFS_DOMAIN_SOCKET_PATH_KEY,
> new File(sockDir.getDir(),
> "testNodeLocalMetrics._PORT.sock").getAbsolutePath());
> MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build();
> try {
> cluster.waitActive();
> FileSystem fs = cluster.getFileSystem();
> Path testFile = new Path("/testNodeLocalMetrics.txt");
> long file_len = 10;
> DFSTestUtil.createFile(fs, testFile, file_len, (short)1, 1L);
> DFSTestUtil.readFile(fs, testFile);
> List<DataNode> datanodes = cluster.getDataNodes();
> assertEquals(datanodes.size(), 1);
> DataNode datanode = datanodes.get(0);
> MetricsRecordBuilder rb = getMetrics(datanode.getMetrics().name());
> // Write related metrics
> assertCounter("WritesFromLocalClient", 1L, rb);
> // Read related metrics
> assertCounter("ReadsFromLocalClient", 1L, rb); // failed here
> } finally {
> if (cluster != null) {
> cluster.shutdown();
> }
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org