[ 
https://issues.apache.org/jira/browse/HDFS-10397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15285308#comment-15285308
 ] 

Jing Zhao commented on HDFS-10397:
----------------------------------

Thanks for updating the patch, Mingliang. The current patch looks good to me in 
general. One minor:
{code}
580         if (useDiff && deleteMissing) {
581           // -delete and -diff are mutually exclusive. For backward 
compatibility,
582           // we ignore the -delete option here, instead of throwing an
583           // IllegalArgumentException. See HDFS-10397 for more discussion.
584           OptionsParser.LOG.warn("-delete and -diff are mutually exclusive. 
" +
585               "The -delete option will be ignored.");
586           setDeleteMissing(false);
587         }
{code}

This logic should be moved to the beginning of the {{valid}} method. I.e., the 
"-deleteMissing" should be bypassed before it causes any exception along with 
some other option settings. A new unit test will also be helpful for this 
scenario.

+1 after addressing the comment.

> Distcp should ignore -delete option if -diff option is provided instead of 
> exiting
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-10397
>                 URL: https://issues.apache.org/jira/browse/HDFS-10397
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.8.0
>            Reporter: Mingliang Liu
>            Assignee: Mingliang Liu
>         Attachments: HDFS-10397.000.patch, HDFS-10397.001.patch, 
> HDFS-10397.002.patch
>
>
> In distcp, {{-delete}} and {{-diff}} options are mutually exclusive. 
> [HDFS-8828] brought strictly checking which makes the existing applications 
> (or scripts) that work just fine with both {{-delete}} and {{-diff}} options 
> previously stop performing because of the 
> {{java.lang.IllegalArgumentException: Diff is valid only with update 
> options}} exception.
> To make it backward incompatible, we can ignore the {{-delete}} option, given 
> {{-diff}} option, instead of exiting the program. Along with that, we can 
> print a warning message saying that _Diff is valid only with update options, 
> and -delete option is ignored_.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to