yashmayya opened a new pull request, #14044:
URL: https://github.com/apache/kafka/pull/14044

   - https://issues.apache.org/jira/browse/KAFKA-15216
   - 
https://github.com/apache/kafka/blob/a1f6ab69387deb10988461152a0087f0cd2827c4/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/InternalSinkRecord.java#L50-L56
   The headers argument passed to the `InternalSinkRecord` constructor is the 
instance field via the accessor `headers()` method instead of the `newRecord` 
method's `headers` argument value (originally discovered 
[here.](https://github.com/apache/kafka/pull/14024#discussion_r1266917499)).
   - This patch fixes the bug, adds a small unit test, and uses fields instead 
of accessor methods everywhere (in `ConnectRecord` and its subclasses) for 
consistency and to prevent the possibility of such bugs arising in the future 
with new fields and method arguments. This requires making instance fields in 
the `ConnectRecord` classes `protected` which makes sense semantically since 
they're properties of both source and sink records and they shouldn't need to 
rely on the public accessor methods (and a similar change for instance fields 
in `SinkRecord` for use in `InternalSinkRecord`).
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to