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

   In the `syncGroupOffset` method, if 
`targetConsumerOffset.get(topicPartition)` gets null, then the calculation of 
`latestDownstreamOffset` will throw NPE. This usually occurs in this situation: 
a group consumed a topic in the target cluster previously. Later, the group 
offset of some partitions was reset to -1, the `OffsetAndMetadata` of these 
partitions was null.
   
   It is possible that when reset offsets are performed in the java kafka 
client, the reset to -1 will be intercepted. However, there are some other 
types of clients such as sarama, which can magically reset the group offset to 
-1, so MM2 will trigger an NPE exception in this scenario. Therefore, a 
defensive measure to avoid NPE is needed here.


-- 
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