Skip to content

Commit

Permalink
fix(core): write next node id into image (#2206)
Browse files Browse the repository at this point in the history
Signed-off-by: Shichao Nie <niesc@automq.com>
  • Loading branch information
SCNieh authored Dec 3, 2024
1 parent 52eb245 commit 46c0e76
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -100,6 +101,7 @@ public void write(ImageWriter writer, ImageWriterOptions options) {
}
}
}
writer.write(new ApiMessageAndVersion(new UpdateNextNodeIdRecord().setNodeId(nextNodeId), (short) 0));
}

@Override
Expand Down

0 comments on commit 46c0e76

Please sign in to comment.