apoorvmittal10 commented on code in PR #23190:
URL: https://github.com/apache/kafka/pull/23190#discussion_r3802635086


##########
share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:
##########
@@ -563,15 +563,23 @@ public 
CoordinatorResult<InitializeShareGroupStateResponseData, CoordinatorRecor
         InitializeShareGroupStateRequestData.PartitionData partitionData = 
topicData.partitions().get(0);
         SharePartitionKey key = 
SharePartitionKey.getInstance(request.groupId(), topicData.topicId(), 
partitionData.partition());
 
-        CoordinatorRecord record = 
generateInitializeStateRecord(partitionData, key);
-        // build successful response if record is correctly created
+        Integer currentStateEpoch = stateEpochMap.get(key);
+        ShareGroupOffset currentState = shareStateMap.get(key);
+
         InitializeShareGroupStateResponseData responseData = new 
InitializeShareGroupStateResponseData().setResults(
             
List.of(InitializeShareGroupStateResponse.toResponseInitializeStateResult(key.topicId(),
                 
List.of(InitializeShareGroupStateResponse.toResponsePartitionResult(
                     key.partition()))
             ))
         );
 
+        if (currentStateEpoch != null && currentStateEpoch == 
partitionData.stateEpoch() &&
+                currentState != null && currentState.startOffset() == 
partitionData.startOffset()) {

Review Comment:
   Should they not have >= check to see if the request is out of order?



-- 
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]

Reply via email to