codelipenghui commented on a change in pull request #8285:
URL: https://github.com/apache/pulsar/pull/8285#discussion_r508438788



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -1350,7 +1351,11 @@ protected void handleSeek(CommandSeek seek) {
             Subscription subscription = consumer.getSubscription();
             MessageIdData msgIdData = seek.getMessageId();
 
-            Position position = new PositionImpl(msgIdData.getLedgerId(), 
msgIdData.getEntryId());
+            long[] ackSet = msgIdData.getAckSetList().stream().mapToLong(x -> 
x).toArray();
+            if (ackSet == null) ackSet = new long[0];
+
+            Position position = new PositionImpl(msgIdData.getLedgerId(),
+                    msgIdData.getEntryId(), ackSet);

Review comment:
       It's better to check the msgIdData.hasAckSetList() first rather than 
create a long[] first




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to