peterxcli commented on code in PR #18096:
URL: https://github.com/apache/kafka/pull/18096#discussion_r1880636310
##########
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 think we can remove this exception here, because
`ShareGroupAutoOffsetResetStrategy` already has the validation itself, so the
.timestamp() must have value if its type is BY_DURATION. And we can add some
comment to indicate this. Thoughts?
--
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]