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

[Rust] Sporadic value-schema mismatch with fixed struct

    XMLWordPrintableJSON

Details

    Description

      We are trying to Avro encode a structure before writing to Kafka, and when we are at high load writing the struct into an Avro writer (we started seeing around 2.6% error rates at 500K messages per minute) we start seeing this error: 

      Value does not match schema: Reason: Unsupported value-schema combination

      This is surprising as the same logic is used to build the record in each case, and that record is built using the Avro record type with the same schema:

      Record::new(&self.schema)

      This is the code that is ultimately raising the error, but because it is not specifying which value does not match which part of the schema, it is extremely difficult to debug.

                      let mut writer = Writer::new(&self.schema, Vec::new());
                      writer
                          .append(record) // This will fail if the message and schema don't match
                          .map_err(|err| Report::msg(err.to_string()))?;

      A simple start would be to add logging of the value and the schema that are mismatched to help us debug this issue, as I'm not able to determine if the `apache-avro` library is doing something erroneous or our code is breaking in some unforeseen way.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              codinganarchy Matthew Tanous
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m