gaurav-narula commented on code in PR #15885:
URL: https://github.com/apache/kafka/pull/15885#discussion_r1597672575


##########
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/ConsumerTask.java:
##########
@@ -153,6 +173,7 @@ public void run() {
 
     private void processConsumerRecord(ConsumerRecord<byte[], byte[]> record) {
         final RemoteLogMetadata remoteLogMetadata = 
serde.deserialize(record.value());
+        onConsume.accept(remoteLogMetadata);

Review Comment:
   Thanks for the suggestion! This made me realise there's also a possible race 
where even after `RemotePartitionMetadataStore::handleRemoteLogSegmentMetadata` 
is invoked, the assertions on `topicBasedRlmm().listRemoteLogSegments` may fail 
because `remoteLogMetadataCache.isInitialized()` may return false.
   
   Inspired by your suggestion to hook on `RemotePartitionMetadataStore`, I've 
modified `TopicBasedRemoteLogMetadataManagerHarness` to accept a spy object for 
it which is passed down to `ConsumerTask`. The tests are modified to ensure 
`handleRemoteLogSegmentMetadata` and `markInitialized` are invoked appropriate 
number of times.



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