thetumbled commented on code in PR #21917:
URL: https://github.com/apache/pulsar/pull/21917#discussion_r1458301356


##########
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java:
##########
@@ -135,7 +135,8 @@ public static Optional<RawMessage> 
rebatchMessage(RawMessage msg,
                                                       
msg.getMessageIdData().getPartition(),
                                                       i);
                 if (!singleMessageMetadata.hasPartitionKey()) {
-                    if (retainNullKey) {
+                    // we may read compacted out message from compacted topic, 
which do not have partition key too.
+                    if (retainNullKey && 
!singleMessageMetadata.isCompactedOut()) {

Review Comment:
   There is no need to move it out, because if one message is compacted out, 
it's `PartitionKey` in the metadata must be null, it is the subcase of the 
`!singleMessageMetadata.hasPartitionKey()`.



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