[
https://issues.apache.org/jira/browse/HADOOP-18446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603198#comment-17603198
]
ASF GitHub Bot commented on HADOOP-18446:
-----------------------------------------
xkrogen commented on code in PR #4871:
URL: https://github.com/apache/hadoop/pull/4871#discussion_r968666305
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverNode.java:
##########
@@ -124,6 +130,42 @@ public static void shutDownCluster() throws IOException {
}
}
+ @Test
+ public void testObserverRequeue() throws Exception {
+ ScheduledExecutorService interruptor =
+ Executors.newScheduledThreadPool(1);
+
+ EditLogTailer observerEditlogTailer = dfsCluster.getNameNode(2)
+ .getNamesystem().getEditLogTailer();
+ RpcMetrics obRpcMetrics = ((NameNodeRpcServer)dfsCluster
+ .getNameNodeRpc(2)).getClientRpcServer().getRpcMetrics();
+
+ // Stop EditlogTailer of Observer NameNode.
+ observerEditlogTailer.stop();
+
+ long oldRequeueNum = obRpcMetrics.getRpcRequeueCalls();
+
+ ScheduledFuture<FileStatus> scheduledFuture = interruptor.schedule(
+ () -> {
+ Path tmpTestPath = new Path("/TestObserverRequeue");
+ dfs.create(tmpTestPath, (short)1).close();
+ assertSentTo(0);
+ // This operation will be blocked in ObserverNameNode
+ // until EditlogTailer tailed edits from journalNode.
+ FileStatus fileStatus = dfs.getFileStatus(tmpTestPath);
+ assertSentTo(2);
+ return fileStatus;
+ }, 0, TimeUnit.SECONDS);
+ Thread.sleep(1000);
+ observerEditlogTailer.doTailEdits();
+ FileStatus fileStatus = scheduledFuture.get(1000, TimeUnit.MILLISECONDS);
Review Comment:
I would recommend a longer value like 10s
> Add a re-queue metric to RpcMetrics.java to quantify the number of re-queue
> RPCs
> --------------------------------------------------------------------------------
>
> Key: HADOOP-18446
> URL: https://issues.apache.org/jira/browse/HADOOP-18446
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: ZanderXu
> Assignee: ZanderXu
> Priority: Minor
> Labels: pull-request-available
>
> Add a reQueue metric to RpcMetrics.java to quantify the number of RPCs
> reQueued.
> Because Observer NameNode will re-queue the rpc if the call processing should
> be postponed.
>
> There is no any metric to quantify the number of re-queue RPCs, so I think we
> should do it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]