apoorvmittal10 commented on code in PR #18096:
URL: https://github.com/apache/kafka/pull/18096#discussion_r1880207231
##########
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:
So, currently, this could only occur when BY_DURATION is used and `duration`
somehow is not set. Would IllegalStateException be better to throw as there
shouldn't be a case when `offsetResetStrategy.timestamp()` should ideally be
empty?
--
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]