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

Avro-C reader ignores final block in file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.7.5
    • 1.7.6
    • c
    • None

    Description

      The Avro-C reader can ignore the final block(s) in a file. It buffers the final block(s) to memory then detects EOF and returns. It doesn't finish reading from the buffer before returning EOF.

      This bug was introduced in AVRO-1238 (https://issues.apache.org/jira/browse/AVRO-1238).

      To reproduce:

      cd avro/lang/c/tests
      
      # copy file with 1 block
      cp avro-1238-good.avro two-blocks.avro
      
      # copy block to make file with 2 blocks
      xxd -c1 -p avro-1238-good.avro | tail -22 | xxd -r -p >>two-blocks.avro
      
      # should return 2*2 = 4 records:
      ../build/src/avrocat two-blocks.avro 
      null
      {"int": 100}
      
      

      Attachments

        1. avro-1364-good.avro
          0.1 kB
          Ben Walsh
        2. AVRO-1364.patch
          6 kB
          Ben Walsh

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bw123 Ben Walsh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: