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

   `RecordCollectorImpl.closeDirty()` aborts the open transaction before 
calling `close()`, which clears the collector's changelog offsets. If the abort 
throws, `close()` is skipped and the offsets are kept. This happens with an 
`IllegalStateException` after a timed-out `commitTransaction()`. The revived 
task reuses the collector, so if it is closed clean while its wiped store is 
still restoring, those stale offsets are checkpointed. The next restore then 
skips the missing records.
   
   This change moves `close()` into a `finally` block so the offsets are always 
cleared. It also logs the abort failure at ERROR before rethrowing. The caller 
still swallows the exception, and before this change it was only logged at 
DEBUG, without the exception.
   
   `CommitTimeoutDirtyCloseIntegrationTest` uses the fault proxy to reproduce 
this. A delayed EndTxn leaves a commit pending, so the abort fails. A later 
`ILLEGAL_GENERATION` on `TxnOffsetCommit` migrates the thread, and the 
restoring task is closed clean.
   
   The associated integration test replicates the issue and without the fix in 
this PR it fails.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to