aloyszhang commented on code in PR #23285: URL: https://github.com/apache/pulsar/pull/23285#discussion_r1756339286
########## pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java: ########## @@ -52,12 +52,16 @@ public static boolean isReadableBatch(MessageMetadata metadata) { return metadata.hasNumMessagesInBatch() && metadata.getEncryptionKeysCount() == 0; } - public static List<MessageCompactionData> extractMessageCompactionData(RawMessage msg) + public static List<MessageCompactionData> extractMessageCompactionData(RawMessage msg, MessageMetadata metadata) throws IOException { checkArgument(msg.getMessageIdData().getBatchIndex() == -1); ByteBuf payload = msg.getHeadersAndPayload(); - MessageMetadata metadata = Commands.parseMessageMetadata(payload); + if (metadata == null) { + metadata = Commands.parseMessageMetadata(payload); Review Comment: I think it's not a problem. Metadata is parsed previously when doing compaction in both phase one and phase two. The null value for metadata only happens in unit tests. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org