chirag-wadhwa5 commented on code in PR #17573:
URL: https://github.com/apache/kafka/pull/17573#discussion_r1815110664
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -382,7 +387,35 @@ public CompletableFuture<Void> maybeInitialize() {
}
// Set the state epoch and end offset from the persisted state.
- startOffset = partitionData.startOffset() != -1 ?
partitionData.startOffset() : 0;
+ if (partitionData.startOffset() !=
PartitionFactory.DEFAULT_START_OFFSET) {
+ startOffset = partitionData.startOffset();
+ } else {
+ GroupConfig.ShareGroupAutoOffsetReset offsetResetStrategy;
+ if (groupConfigManager.groupConfig(groupId).isPresent()) {
+ offsetResetStrategy =
groupConfigManager.groupConfig(groupId).get().shareAutoOffsetReset();
+ if (offsetResetStrategy ==
GroupConfig.ShareGroupAutoOffsetReset.UNKNOWN) {
+ offsetResetStrategy =
GroupConfig.defaultShareAutoOffsetReset();
+ }
+ } else {
+ offsetResetStrategy =
GroupConfig.defaultShareAutoOffsetReset();
+ }
+
+ if (offsetResetStrategy ==
GroupConfig.ShareGroupAutoOffsetReset.EARLIEST) {
Review Comment:
Thanks for the review. I have pushed everything into a new method, things
should look better after the next commit is pushed.
--
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]