diff --git a/metadata/src/main/java/org/apache/kafka/image/ClusterImage.java b/metadata/src/main/java/org/apache/kafka/image/ClusterImage.java index 35160c74fd..aa8bdfe6e9 100644 --- a/metadata/src/main/java/org/apache/kafka/image/ClusterImage.java +++ b/metadata/src/main/java/org/apache/kafka/image/ClusterImage.java @@ -17,17 +17,18 @@ package org.apache.kafka.image; +import org.apache.kafka.common.metadata.UpdateNextNodeIdRecord; import org.apache.kafka.image.node.ClusterImageNode; import org.apache.kafka.image.writer.ImageWriter; import org.apache.kafka.image.writer.ImageWriterOptions; import org.apache.kafka.metadata.BrokerRegistration; import org.apache.kafka.metadata.ControllerRegistration; +import org.apache.kafka.server.common.ApiMessageAndVersion; import java.util.Collections; import java.util.Map; import java.util.Objects; - /** * Represents the cluster in the metadata image. * @@ -100,6 +101,7 @@ public void write(ImageWriter writer, ImageWriterOptions options) { } } } + writer.write(new ApiMessageAndVersion(new UpdateNextNodeIdRecord().setNodeId(nextNodeId), (short) 0)); } @Override