[ https://issues.apache.org/jira/browse/HDFS-17337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17805522#comment-17805522 ]
ASF GitHub Bot commented on HDFS-17337: --------------------------------------- hfutatzhanghb commented on PR #6439: URL: https://github.com/apache/hadoop/pull/6439#issuecomment-1886944583 @Hexiaoqiao @zhangshuyan0 @tomscut @slfan1989 Sir, could you please review this PR when you have free time? Thanks a lot ~ > RPC RESPONSE time seems not exactly accurate when using FSEditLogAsync. > ----------------------------------------------------------------------- > > Key: HDFS-17337 > URL: https://issues.apache.org/jira/browse/HDFS-17337 > Project: Hadoop HDFS > Issue Type: Bug > Components: namenode > Affects Versions: 3.3.6 > Reporter: farmmamba > Assignee: farmmamba > Priority: Major > Labels: pull-request-available > > Currently, FSEditLogAsync is enabled by default. > We have below codes in method Server$RpcCall#run: > > {code:java} > if (!isResponseDeferred()) { > long deltaNanos = Time.monotonicNowNanos() - startNanos; > ProcessingDetails details = getProcessingDetails(); > details.set(Timing.PROCESSING, deltaNanos, TimeUnit.NANOSECONDS); > deltaNanos -= details.get(Timing.LOCKWAIT, TimeUnit.NANOSECONDS); > deltaNanos -= details.get(Timing.LOCKSHARED, TimeUnit.NANOSECONDS); > deltaNanos -= details.get(Timing.LOCKEXCLUSIVE, TimeUnit.NANOSECONDS); > details.set(Timing.LOCKFREE, deltaNanos, TimeUnit.NANOSECONDS); > startNanos = Time.monotonicNowNanos(); > setResponseFields(value, responseParams); > sendResponse(); > deltaNanos = Time.monotonicNowNanos() - startNanos; > details.set(Timing.RESPONSE, deltaNanos, TimeUnit.NANOSECONDS); > } else { > if (LOG.isDebugEnabled()) { > LOG.debug("Deferring response for callId: " + this.callId); > } > }{code} > It computes Timing.RESPONSE of a RpcCall using *Time.monotonicNowNanos() - > startNanos;* > However, if we use async editlogging, we will not send response here but in > FSEditLogAsync.RpcEdit#logSyncNotify. > This causes the Timing.RESPONSE of a RpcCall not be exactly accurate. > {code:java} > @Override > public void logSyncNotify(RuntimeException syncEx) { > try { > if (syncEx == null) { > call.sendResponse(); > } else { > call.abortResponse(syncEx); > } > } catch (Exception e) {} // don't care if not sent. > } {code} > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org