[
https://issues.apache.org/jira/browse/YARN-4720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167718#comment-15167718
]
Ming Ma commented on YARN-4720:
-------------------------------
Even though all tests passed by jenkins, but if you run the new
{{testSkipUnnecessaryNNOperations}} individually, it failed. Based on how the
test is written, {{this.context.getLogAggregationStatusForApps().size()}}
should be 4. The reason it passes if all tests run together could be due to the
fact that second {{doLogAggregationOutOfBand()}} and the
{{LogHandlerAppFinishedEvent}} right after that only cause one notification.
After fixing the size check to 4, additional sleep after the second
{{doLogAggregationOutOfBand()}} fixes the issue, or you can wait and verify
{{getLogAggregationStatusForApps.size()}} after each
{{doLogAggregationOutOfBand()}} call.
In addition, it might be useful to add another test case without long running
service but with FailedOrKilledContainerLogAggregationPolicy; For that case, no
log aggregation should happen. That will help to verify the other scenario.
What do you think, [~hex108]?
> Skip unnecessary NN operations in log aggregation
> -------------------------------------------------
>
> Key: YARN-4720
> URL: https://issues.apache.org/jira/browse/YARN-4720
> Project: Hadoop YARN
> Issue Type: Improvement
> Reporter: Ming Ma
> Assignee: Jun Gong
> Attachments: YARN-4720.01.patch, YARN-4720.02.patch,
> YARN-4720.03.patch, YARN-4720.04.patch
>
>
> Log aggregation service could have unnecessary NN operations in the following
> scenarios:
> * No new local log has been created since the last upload for the long
> running service scenario.
> * NM uses {{ContainerLogAggregationPolicy}} that skips log aggregation for
> certain containers.
> In the following code snippet, even though {{pendingContainerInThisCycle}} is
> empty, it still creates the writer and then removes the file later. Thus it
> introduces unnecessary create/getfileinfo/delete NN calls when NM doesn't
> aggregate logs for an app.
>
> {noformat}
> AppLogAggregatorImpl.java
> ......
> writer =
> new LogWriter(this.conf, this.remoteNodeTmpLogFileForApp,
> this.userUgi);
> ......
> for (ContainerId container : pendingContainerInThisCycle) {
> ......
> }
> ......
> if (remoteFS.exists(remoteNodeTmpLogFileForApp)) {
> if (rename) {
> remoteFS.rename(remoteNodeTmpLogFileForApp, renamedPath);
> } else {
> remoteFS.delete(remoteNodeTmpLogFileForApp, false);
> }
> }
> ......
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)