chirag-wadhwa5 commented on code in PR #17573:
URL: https://github.com/apache/kafka/pull/17573#discussion_r1815105965
##########
share/src/main/java/org/apache/kafka/server/share/persister/PartitionFactory.java:
##########
@@ -26,7 +26,7 @@
*/
public class PartitionFactory {
public static final int DEFAULT_STATE_EPOCH = 0;
- public static final int DEFAULT_START_OFFSET = 0;
+ public static final int DEFAULT_START_OFFSET = -1;
Review Comment:
Thanks for the review. In future we could have a case where the startOffset
returned from persister could be 0 and that's not the default value (because
the start offset stored in __share_group_state topic for this share partition
was actually 0). One way to distinguish that case could be to have the
following check -
if (partitionData.startOffset() == 0 && partitionData.stateBatches().size()
== 0 ) => then we conclude that this is indeed the default value in the case
when the share partition was initialized for the first time. Should that be
fine ? @AndrewJSchofield @apoorvmittal10
--
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]