cmccabe commented on code in PR #12715:
URL: https://github.com/apache/kafka/pull/12715#discussion_r991450870
##########
metadata/src/main/java/org/apache/kafka/image/AclsImage.java:
##########
@@ -53,13 +49,15 @@ public Map<Uuid, StandardAcl> acls() {
return acls;
}
- public void write(Consumer<List<ApiMessageAndVersion>> out) {
- List<ApiMessageAndVersion> batch = new ArrayList<>();
+ public void write(ImageWriter writer, ImageWriterOptions options) {
+ // Technically, AccessControlEntryRecord appeared in 3.2-IV0, so we
should not write it if
+ // the output version is less than that. However, there is a problem:
pre-production KRaft
+ // images didn't support FeatureLevelRecord, so we can't distinguish
3.2-IV0 from 3.0-IV1.
+ // The least bad way to resolve this is just to pretend that ACLs were
in 3.0-IV1.
for (Entry<Uuid, StandardAcl> entry : acls.entrySet()) {
StandardAclWithId aclWithId = new
StandardAclWithId(entry.getKey(), entry.getValue());
- batch.add(new ApiMessageAndVersion(aclWithId.toRecord(), (short)
0));
+ writer.write(0, aclWithId.toRecord());
Review Comment:
There are only two places that generate these records. `Image.java` and
friends, and the controller. In both cases, we don't have a single version that
we care about, but we have to emit the correct record version (which will
depend on the current metadata version)
I don't think a constant helps here. In fact I think it would confuse the
issue since there are multiple versions we might need to emit.
--
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]