apoorvmittal10 commented on code in PR #18096:
URL: https://github.com/apache/kafka/pull/18096#discussion_r1880683011
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -2125,16 +2128,25 @@ private long startOffsetDuringInitialization(long
partitionDataStartOffset) thro
if (partitionDataStartOffset !=
PartitionFactory.UNINITIALIZED_START_OFFSET) {
return partitionDataStartOffset;
}
- GroupConfig.ShareGroupAutoOffsetReset offsetResetStrategy;
+ ShareGroupAutoOffsetResetStrategy offsetResetStrategy;
if (groupConfigManager.groupConfig(groupId).isPresent()) {
offsetResetStrategy =
groupConfigManager.groupConfig(groupId).get().shareAutoOffsetReset();
} else {
offsetResetStrategy = GroupConfig.defaultShareAutoOffsetReset();
}
- if (offsetResetStrategy ==
GroupConfig.ShareGroupAutoOffsetReset.EARLIEST)
+ if (offsetResetStrategy.timestamp().isEmpty()) {
+ throw new Exception("The timestamp is not available for the share
partition: " + topicIdPartition);
Review Comment:
I would say it would be good to have a check as the method returns Optional.
If it can never be empty then the method should never return Optional.
--
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]