codelipenghui commented on code in PR #16996:
URL: https://github.com/apache/pulsar/pull/16996#discussion_r940996272
##########
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java:
##########
@@ -1850,10 +1850,9 @@ public static MessageMetadata
peekMessageMetadata(ByteBuf metadataAndPayload, St
long consumerId) {
try {
// save the reader index and restore after parsing
- int readerIdx = metadataAndPayload.readerIndex();
+ metadataAndPayload.markReaderIndex();
MessageMetadata metadata =
Commands.parseMessageMetadata(metadataAndPayload);
- metadataAndPayload.readerIndex(readerIdx);
-
+ metadataAndPayload.resetReaderIndex();
Review Comment:
+1, I think we can keep this PR only focused on the revert job. If this is a
part need to improve, it's better to create a separate PR.
--
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]