Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9763

Recent changes to Connect's InsertField will fail to inject field on key of tombstone record

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.3, 1.1.2, 2.0.2, 2.1.2, 2.2.2, 2.4.0, 2.3.1, 2.5.0
    • 1.0.3, 1.1.2, 2.0.2, 2.1.2, 2.2.3, 2.3.2, 2.4.2, 2.5.1
    • connect
    • None

    Description

      This is a regression due to the changes for KAFKA-8523.

      KAFKA-8523 was backported to multiple versions, and was released into 2.2.2, 2.3.1, and 2.4.0, and will soon be released in 2.5.0.

      Unfortunately, that fix always makes the `InsertField` SMT skip all tombstone records, even when using the `InsertField$Key`.

      Rather than:

          private boolean isTombstoneRecord(R record) {
              return record.value() == null;
          }
      

      the correct behavior would be:

           private boolean isTombstoneRecord(R record) {
               return operatingValue(record) == null;
           }
      

      The method no longer detects just tombstone methods, so the code should be refactored to return the record if the operatingValue for the record (which for `InsertField$Key` is the record key and for `InsertField$Value` is the record value) is null.

       

      Attachments

        Issue Links

          Activity

            People

              rhauch Randall Hauch
              rhauch Randall Hauch
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: