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

Snapshot file is broken after appending to original file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.2.0
    • None
    • hdfs-client
    • None

    Description

      Reproduce Step
      1) cat snapshot.sh
      sudo -u hdfs hdfs dfs -mkdir /test
      sudo -u hdfs hdfs dfsadmin -allowSnapshot /test
      rm -rf /tmp/mytest
      echo mytest > /tmp/mytest
      rm -rf /tmp/myappend
      echo myappend > /tmp/myappend
      sudo -u hdfs hdfs dfs -copyFromLocal /tmp/mytest /test
      sudo -u hdfs hdfs dfs -createSnapshot /test snap1
      sudo -u hdfs hdfs dfs -cat /test/.snapshot/snap1/mytest
      sudo -u hdfs hdfs dfs -appendToFile /tmp/myappend /test/mytest
      echo "expect mytest"
      sudo -u hdfs hdfs dfs -cat /test/.snapshot/snap1/mytest
      sudo -u hdfs hdfs dfs -deleteSnapshot /test/ snap1
      sudo -u hdfs hdfs dfsadmin -disallowSnapshot /test/
      sudo -u hdfs hdfs dfs -rm /test/mytest
      sudo -u hdfs hdfs dfs -rmdir /test/

      2. Test result:
      [hadoop@localhost ~]$ ./snapshot.sh
      Allowing snaphot on /test succeeded
      Created snapshot /test/.snapshot/snap1
      mytest
      expect mytest
      mytest
      myappend <<< myappend is not expected

      Attachments

        Activity

          People

            Unassigned Unassigned
            rguo Guo Ruijing
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: