[
https://issues.apache.org/jira/browse/HADOOP-18446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17604944#comment-17604944
]
ASF GitHub Bot commented on HADOOP-18446:
-----------------------------------------
xkrogen commented on code in PR #4871:
URL: https://github.com/apache/hadoop/pull/4871#discussion_r971234834
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcMetrics.java:
##########
@@ -344,6 +353,15 @@ public long getRpcSlowCalls() {
return rpcSlowCalls.value();
}
+ /**
+ * Returns the number of requeue calls;
Review Comment:
Checkstyle complains:
```
./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/metrics/RpcMetrics.java:192:
/**: First sentence should end with a period. [JavadocStyle]
```
Can you change the semicolon to a period? `; -> .`
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverNode.java:
##########
@@ -156,14 +155,17 @@ public void testObserverRequeue() throws Exception {
assertSentTo(2);
return fileStatus;
}, 0, TimeUnit.SECONDS);
- Thread.sleep(1000);
- observerEditlogTailer.doTailEdits();
- FileStatus fileStatus = scheduledFuture.get(1000, TimeUnit.MILLISECONDS);
+
+ GenericTestUtils.waitFor(() -> obRpcMetrics.getRpcRequeueCalls() >
oldRequeueNum,
+ 50, 10000);
+
+ observerFsNS.getEditLogTailer().doTailEdits();
+ FileStatus fileStatus = scheduledFuture.get(10000, TimeUnit.MILLISECONDS);
assertNotNull(fileStatus);
- assertTrue(obRpcMetrics.getRpcRequeueCalls() > oldRequeueNum);
- dfsCluster.getNameNode(2).getNamesystem()
- .startNewEditLogTailer(dfsCluster.getConfiguration(2));
+ EditLogTailer editLogTailer = new EditLogTailer(observerFsNS, conf);
+ observerFsNS.setEditLogTailerForTests(editLogTailer);
+ editLogTailer.start();
Review Comment:
Just realized we should do this in a try-finally since we are trying to
clean up our modifications for other tests, e.g. right now if the `waitFor()`
call fails then we won't reset the `editLogTailer` and other tests may fail as
a result
> 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]