divijvaidya commented on code in PR #13936:
URL: https://github.com/apache/kafka/pull/13936#discussion_r1255777691


##########
storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogSegmentMetadata.java:
##########
@@ -100,7 +100,16 @@ public RemoteLogSegmentMetadata(RemoteLogSegmentId 
remoteLogSegmentId,
         this.remoteLogSegmentId = Objects.requireNonNull(remoteLogSegmentId, 
"remoteLogSegmentId can not be null");
         this.state = Objects.requireNonNull(state, "state can not be null");
 
+        if (startOffset < 0) {
+            throw new IllegalArgumentException(
+                String.format("Unexpected start offset = %d. StartOffset for a 
remote segment cannot negative", startOffset));
+        }
         this.startOffset = startOffset;
+
+        if (endOffset < 0) {
+            throw new IllegalArgumentException(
+                String.format("Unexpected end offset = %d. EndOffset for a 
remote segment cannot negative", endOffset));
+        }

Review Comment:
   fixed in latest commit



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