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

SnapshotDiffReport should detect open files in HDFS Snapshots



    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Workaround
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.9.0, 3.0.0-beta1
    • Component/s: snapshots
    • Labels:



      1. When there are files being written and when HDFS Snapshots are taken in parallel, Snapshots do capture all these files, but these being written files in Snapshots do not have the point-in-time file length captured. Most of the times, these open files will have a length of 0, or the last block boundary size.

      2. Only at the time of File close or any other meta data modification operation on these files, HDFS reconciles the file length and records the modification in the last taken Snapshot. All the previously taken Snapshots continue to have those open Files with no modification recorded. So, all those previous snapshots end up using the final modification record in the next available snapshot. So, after the file close, file lengths in all those snapshots will end up same.

      Assume File1 is opened for write and a total of 1MB written to it. While the writes are happening, snapshots are taken in parallel.


      Then at time,
      Snap1.File1.length = 0

      Snap1.File1.length = 0
      Snap2.File1.length = 0

      <File1 write completed and closed>

      Snap1.File1.length = 1MB
      Snap2.File1.length = 1MB
      Snap3.File1.length = 1MB

      So, Snapshot Diff Report running against any of above snapshots will not detect any delta changes in the open files.


      1. HDFS Snapshots can stash open file details in the snapshot record.
      2. NameNode might not have the accurate byte level length visibility on the open files, Snapshots might not have the accurate point-in-time length captured. So, SnapshotDiffReport can have an option to detect open files and always show M flag for the open files, if the files are available on both the snapshots it is running against with.

      hdfs snapshotDiff -includeOpenFiles <snapDir> <snapName> <snapName>


          Issue Links



              • Assignee:
                manojg Manoj Govindassamy
                manojg Manoj Govindassamy
              • Votes:
                0 Vote for this issue
                6 Start watching this issue


                • Created: