Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-17848

Hadoop NativeAzureFileSystem append removes ownership set on the file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.3.1
    • None
    • None
    • None

    Description

      Repro: Create Operation sets ownership whereas append operation removes the same.

      Create:

      // rw-rr- 1 root supergroup 1 2021-08-15 11:02 /tmp/dummyfile

      Append:

      // -rwxrwxrwx 1 <NULL>  <NULL> 2 2021-08-15 11:04 /tmp/dummyfile

      import org.apache.hadoop.conf.Configuration;
      import org.apache.hadoop.fs.FSDataOutputStream;
      import org.apache.hadoop.fs.FileSystem;
      import org.apache.hadoop.fs.Path;
      import org.apache.hadoop.fs.permission.FsPermission;
      
      public class Wasb {
      
       private static final short FILE_LOG_PERMISSIONS = 0640;
       
       public static void main(String[] args) throws Exception {
       
          Configuration fsConf = new Configuration();
          fsConf.set("fs.azure.enable.append.support", "true");
      
      Path filePath = new Path("/tmp/dummyfile");
      
      FileSystem fs = FileSystem.newInstance(filePath.toUri(), fsConf);
      
      FSDataOutputStream stream = fs.create(filePath, false);
      stream.write(12345);
      stream.close();
      
      stream = fs.append(filePath);
      stream.write(888);
      stream.close();
      
      fs.close();
       }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            prabhujoseph Prabhu Joseph
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: