Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-9820

Improve distcp to support efficient restore to an earlier snapshot

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      A common use scenario (scenaio 1):

      1. create snapshot sx in clusterX,
      2. do some experiemnts in clusterX, which creates some files.
      3. throw away the files changed and go back to sx.

      Another scenario (scenario 2) is, there is a production cluster and a backup cluster, we periodically sync up the data from production cluster to the backup cluster with distcp.

      The cluster in scenario 1 could be the backup cluster in scenario 2.

      For scenario 1:

      HDFS-4167 intends to restore HDFS to the most recent snapshot, and there are some complexity and challenges. Before that jira is implemented, we count on distcp to copy from snapshot to the current state. However, the performance of this operation could be very bad because we have to go through all files even if we only changed a few files.

      For scenario 2:

      HDFS-7535 improved distcp performance by avoiding copying files that changed name since last backup.

      On top of HDFS-7535, HDFS-8828 improved distcp performance when copying data from source to target cluster, by only copying changed files since last backup. The way it works is use snapshot diff to find out all files changed, and copy the changed files only.

      See https://blog.cloudera.com/blog/2015/12/distcp-performance-improvements-in-apache-hadoop/

      This jira is to propose a variation of HDFS-8828, to find out the files changed in target cluster since last snapshot sx, and copy these from snapshot sx of either the source or the target cluster, to restore target cluster's current state to sx.

      Specifically,

      If a file/dir is

      • renamed, rename it back
      • created in target cluster, delete it
      • modified, put it to the copy list
      • run distcp with the copy list, copy from the source cluster's corresponding snapshot

      This could be a new command line switch -rdiff in distcp.

      As a native restore feature, HDFS-4167 would still be ideal to have. However, HDFS-9820 would hopefully be easier to implement, before HDFS-4167 is in place.

      Attachments

        1. HDFS-9820.001.patch
          51 kB
          Yongjun Zhang
        2. HDFS-9820.002.patch
          56 kB
          Yongjun Zhang
        3. HDFS-9820.003.patch
          51 kB
          Yongjun Zhang
        4. HDFS-9820.004.patch
          59 kB
          Yongjun Zhang
        5. HDFS-9820.005.patch
          80 kB
          Yongjun Zhang
        6. HDFS-9820.006.patch
          76 kB
          Yongjun Zhang
        7. HDFS-9820.007.patch
          77 kB
          Yongjun Zhang
        8. HDFS-9820.008.patch
          77 kB
          Yongjun Zhang
        9. HDFS-9820.009.patch
          77 kB
          Yongjun Zhang
        10. HDFS-9820.branch-2.002.patch
          82 kB
          Yongjun Zhang
        11. HDFS-9820.branch-2.patch
          82 kB
          Yongjun Zhang

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            yzhangal Yongjun Zhang
            yzhangal Yongjun Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment