cadonna opened a new pull request #9066:
URL: https://github.com/apache/kafka/pull/9066


   In PR #8962 we introduced a sentinel UNKNOWN_OFFSET to mark unknown offsets 
in checkpoint files. The sentinel was set to -2 which is the same value used 
for the sentinel LATEST_OFFSET that is used in subscriptions to signal that 
state stores have been used by an active task. Unfortunately, we missed to skip 
UNKNOWN_OFFSET when we compute the sum of the changelog offsets. 
   
   If a task had only one state store and it did not restore anything before 
the next rebalance, the stream thread wrote -2 (i.e., UNKNOWN_OFFSET) into the 
subscription as sum of the changelog offsets. During assignment, the leader 
interpreted the -2 as if the stream run the task as active although it might 
have run it as standby. This misinterpretation of the sentinel value resulted 
in unexpected task assigments.  
   
   ### 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.

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


Reply via email to