dengziming commented on pull request #11681:
URL: https://github.com/apache/kafka/pull/11681#issuecomment-1078739838


   > if we don't advertise the offset to controller,
   
   @showuon, Here, Jason means we postpone advertising offset after the 
publisher has finished publishing, which means MetadataCache has been updated.
   
   We can achieve it in a simpler way here:
   1. Add a method/field in MetadataPublisher, def highestMetadataOffset long
   2. every time we call `BrokerMetadataPublisher.publish()`, we set the 
`highestMetadataOffset` to the newest offset, maybe we should add a parameter 
logEndOffset to `BrokerMetadataPublisher.publish()`
   3. Change the code `lifecycleManager.start(() => 
metadataListener.highestMetadataOffset )` to `lifecycleManager.start(() => 
metadataPublisher.highestMetadataOffset` in `BrokerServer`.
   
   PTAL. 
   
   


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