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

Ayush Saxena commented on HDFS-15916:
-------------------------------------

Well in any case if older client isn't able to connect to newer server, that 
would be a big problem, but in this case also I don't think there is any harm 
supporting a newer client to connect to an older server by means of a fallback.

DistCp is a tool commonly used for migration and usually the data copy is done 
at the load(newer cluster) since the source cluster is serving the client 
requests till the migration is complete.

And DistCp is a widely used util, supporting new client to old server should be 
good, most of the commonly used APIs do work that way barring some.

IMO adding a fallback won't have any performance implications in the present 
code, so no resistance that way, Just something like below in 
\{{getSnapshotDiffReportInternal}} (I suppose)
{code:java}
try {
  report = dfs.getSnapshotDiffReportListing(snapshotDir, fromSnapshot,
      toSnapshot, startPath, index);
} catch (RpcNoSuchMethodException e) {
  return dfs.getSnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot);
}{code}
There is a fallback for a case in the API today also:
{code:java}
// In case the diff needs to be computed between a snapshot and the current
// tree, we should not do iterative diffReport computation as the iterative
// approach might fail if in between the rpc calls the current tree
// changes in absence of the global fsn lock.
if (!isValidSnapshotName(fromSnapshot) || !isValidSnapshotName(
    toSnapshot)) {
  return dfs.getSnapshotDiffReport(snapshotDir, fromSnapshot, toSnapshot);
}{code}
[~zhenshan.wen] does that makes sense now?

 

> Backward compatibility - Distcp fails from Hadoop 3 to Hadoop 2 for 
> snapshotdiff
> --------------------------------------------------------------------------------
>
>                 Key: HDFS-15916
>                 URL: https://issues.apache.org/jira/browse/HDFS-15916
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: distcp
>    Affects Versions: 3.2.2
>            Reporter: Srinivasu Majeti
>            Priority: Major
>
> Looks like when using distcp diff options between two snapshots from a hadoop 
> 3 cluster to hadoop 2 cluster , we get below exception and seems to be break 
> backward compatibility due to new API introduction 
> getSnapshotDiffReportListing.
>  
> {code:java}
> hadoop distcp -diff s1 s2 -update src_cluster_path dst_cluster_path
> org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.RpcNoSuchMethodException):
>  Unknown method getSnapshotDiffReportListing called on 
> org.apache.hadoop.hdfs.protocol.ClientProtocol protocol
>  {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
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