kamalcph commented on code in PR #22774:
URL: https://github.com/apache/kafka/pull/22774#discussion_r3538137893


##########
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/ConsumerTask.java:
##########
@@ -168,13 +168,17 @@ void closeConsumer() {
     }
 
     private void processConsumerRecord(ConsumerRecord<byte[], byte[]> record) {
-        final RemoteLogMetadata remoteLogMetadata = 
serde.deserialize(record.value());
-        if (shouldProcess(remoteLogMetadata, record.offset())) {
-            
remotePartitionMetadataEventHandler.handleRemoteLogMetadata(remoteLogMetadata);
-            
readOffsetsByUserTopicPartition.put(remoteLogMetadata.topicIdPartition(), 
record.offset());
-        } else {
-            log.trace("The event {} is skipped because it is either already 
processed or not assigned to this consumer",
-                    remoteLogMetadata);
+        byte[] value = record.value();
+        // skip the tombstone records
+        if (value != null) {
+            final RemoteLogMetadata remoteLogMetadata = 
serde.deserialize(value);
+            if (shouldProcess(remoteLogMetadata, record.offset())) {

Review Comment:
   UTs need an update once the approach is fine.



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