C0urante opened a new pull request #11526:
URL: https://github.com/apache/kafka/pull/11526


   [Jira](https://issues.apache.org/jira/browse/KAFKA-13472)
   
   The `WorkerSinkTask.lastCommittedOffsets` field is now added to (via 
`Map::putAll`) after a successful offset commit, instead of being completely 
overwritten. In order to prevent this collection from growing indefinitely, 
elements are removed from it after topic partitions are revoked from the task's 
consumer.
   
   Two test cases are added to `WorkerSinkTaskTest`:
   
   - A basic test to verify the "rewind for redelivery" behavior when a task 
throws an exception from `SinkTask::preCommit`; surprisingly, no existing test 
cases appear to cover this scenario
   - A more sophisticated test to verify this same behavior, but with a few 
rounds of cooperative consumer rebalancing beforehand that expose a bug in the 
current logic for the `WorkerSinkTask` class
   
   The `VerifiableSinkTask` class is also updated to only flush the requested 
topic partitions in its `flush` method. This is technically unrelated to the 
issue addressed by this PR and can be moved to a separate PR if necessary; 
including it here as the original context for identifying this bug was 
debugging failed system tests and the logic in this part of the tests was 
originally suspected as a cause of the test failure.
   
   ### 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