DGS-23821 Default names and updated frozen/non-frozen workflow support#4229
DGS-23821 Default names and updated frozen/non-frozen workflow support#4229Robert Yokota (rayokota) wants to merge 20 commits into8.0.xfrom
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
...fluent/kafka/schemaregistry/client/rest/entities/requests/AssociationCreateOrUpdateInfo.java
Show resolved
Hide resolved
...onfluent/kafka/schemaregistry/client/rest/entities/requests/AssociationCreateOrUpdateOp.java
Outdated
Show resolved
Hide resolved
...ava/io/confluent/kafka/schemaregistry/client/rest/entities/requests/AssociationCreateOp.java
Outdated
Show resolved
Hide resolved
...fluent/kafka/schemaregistry/client/rest/entities/requests/AssociationCreateOrUpdateInfo.java
Show resolved
Hide resolved
...fluent/kafka/schemaregistry/client/rest/entities/requests/AssociationCreateOrUpdateInfo.java
Show resolved
Hide resolved
core/src/main/java/io/confluent/kafka/schemaregistry/storage/KafkaSchemaRegistry.java
Outdated
Show resolved
Hide resolved
| + "-" + createOrUpdateOp.getAssociationType(); | ||
| if (createOrUpdateOp.getSubject() == null) { | ||
| createOrUpdateOp.setSubject(defaultSubject); | ||
| } |
There was a problem hiding this comment.
In the AlterConfig case, user can just change lifecycle by only specifying lifecycle in the request. The intention is to mutate the existing subject's lifecycle.
Since no subject presents in the request, this code will set default subject to it, which is likely to be different from the real associated subject.
There was a problem hiding this comment.
Good point, I changed the error message to make it clear
"subject of association cannot be changed from '"
+ + association.getSubject() + "' to '" + unqualifiedSubject + "'
There was a problem hiding this comment.
Robert Yokota (@rayokota) Hi Robert, I am not sure if I followed your logic.
My question is that in the AlterConfig case, it is incremental alter config, so users are allowed to only specify properties they want to change, and leave the rest unspecified.
In the case where the user only specifies the new lifecycle , since the subject is absent from the request, our code:
"""
if (createOrUpdateOp.getSubject() == null) {
createOrUpdateOp.setSubject(defaultSubject);
}
"""
will always set it to the default subject, which we shouldn't. The subjects should be passed as null to the server and be resolved on server side based on the existing association. Does that make sense?
|


What
This PR adds the following requirements:
Explicitly setting lifecycle=WEAK or frozen=false with a schema is rejected.
:.{resourceNamespace}:{resourceName}-{associationType}. For CREATE, subject is required for WEAK associations. WEAK associations cannot use the default subject format.
rejected for frozen associations.
non-frozen associations is rejected. Creating a frozen association on a resource with existing non-frozen associations (or vice versa) is rejected.
fills in subject from the existing association. If no existing association exists, the server applies CREATE defaults (schema→STRONG+frozen with default subject, otherwise lifecycle
defaults to WEAK which requires explicit subject). STRONG with default subject cannot be changed to WEAK.
Checklist
Please answer the questions with Y, N or N/A if not applicable.
References
JIRA:
Test & Review
Open questions / Follow-ups