jeffkbkim commented on code in PR #14849:
URL: https://github.com/apache/kafka/pull/14849#discussion_r1408090316
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntime.java:
##########
@@ -543,8 +543,14 @@ private void transitionTo(
case ACTIVE:
state = CoordinatorState.ACTIVE;
- snapshotRegistry.getOrCreateSnapshot(0);
partitionWriter.registerListener(tp,
highWatermarklistener);
+
+ // If the partition did not contain any records, we would
not have generated a snapshot
+ // while loading.
+ if (lastWrittenOffset == -1L) {
+ updateLastWrittenOffset(0);
+ updateLastCommittedOffset(0);
+ }
Review Comment:
for both offsets, are you saying that we won't hit the case where we update
HWM or last written offset to 0 while loading? SInce we throw an exception in
both methods
```
if (offset <= lastWrittenOffset) {
throw new IllegalStateException("New last written offset " +
offset + " of " + tp +
" must be larger than " + lastWrittenOffset + ".");
}
```
Which is why I initialized them as -1L
--
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]