Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2166

Wrong Sync header appended to the file.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Bug
    • 1.8.2
    • None
    • java
    • None
    • This was an internal coding issue. Apologize for the same.

    Description

      We are using the following code, pseudo code for representation.
       

       File file1 = new File("/tmp/tmpdata/message-" + System.currentTimeMillis());
       FileOutputStream out = new FileOutputStream(file1, false);
       DatumWriter datumWriter = new GenericDatumWriter<>();
       writer = new DataFileWriter(datumWriter);
       writer.setCodec(CodecFactory.snappyCodec());
       writer.create(avroSchema, out);
       
      //Records are from sink connector of kafka.   
      //Iterator over the records and bundling them together.
       for( set of records ... )
          writer.append(value);
       writer.close();
      
      

      The issue which we are facing is the sync code is not matching.

       Original file with sync code at the end is wrong. avro tool failed with error invalid sync.

      Since the header.sync and sync bytes after the block didnot match.

      manually -replaced the 16 byte with sync bytes from the header section. the file i was able to read using avro tools.

       Thanks and Best Regards

      Mukesh

       

      Attachments

        1. original-snappy-file.PNG
          44 kB
          mukesh katariya
        2. corrected-manualy.PNG
          49 kB
          mukesh katariya

        Activity

          People

            Unassigned Unassigned
            jmukesh mukesh katariya
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: