kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2487789927


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1139,6 +1153,10 @@ class CompleteActivationEvent implements 
ControllerWriteOperation<Void> {
         @Override
         public ControllerResult<Void> generateRecordsAndResult() {
             try {
+                if (bootstrapMetadata == null) {
+                    throw new IllegalStateException("Bootstrap metadata not 
available during activation. " +
+                        "This should not happen if a bootstrap snapshot was 
processed.");
+                }

Review Comment:
   We should allow bootstrapMetadata to be null here because we can be in the 
case where we bootstrapped using `0-0.checkpoint`, but that file no longer 
exists because it was cleaned up by KRaft. However, it cannot be null when we 
call `recordsForEmptyLog`. It can be null when we call `recordsForNonEmptyLog`



##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1139,6 +1153,10 @@ class CompleteActivationEvent implements 
ControllerWriteOperation<Void> {
         @Override
         public ControllerResult<Void> generateRecordsAndResult() {
             try {
+                if (bootstrapMetadata == null) {
+                    throw new IllegalStateException("Bootstrap metadata not 
available during activation. " +
+                        "This should not happen if a bootstrap snapshot was 
processed.");
+                }

Review Comment:
   We should allow bootstrapMetadata to be null here because we can be in the 
case where we bootstrapped using `0-0.checkpoint`, but that file no longer 
exists because it was cleaned up by KRaft. However, bootstrapMetadata cannot be 
null when we call `recordsForEmptyLog`. It can be null when we call 
`recordsForNonEmptyLog`



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